The agreement was signed soon after Trump arrived at a summit of the Association of Southeast Asian Nations in Kuala Lumpur.
It builds on a truce reached three months ago after Trump called the then leaders of the two countries and urged them to end hostilities or risk putting their respective trade talks with Washington on hold.
Both sides blame each other for starting the five-day exchange of rockets and heavy artillery, which killed at least 48 people and temporarily displaced an estimated 300,000 people in their worst fighting in recent history.
Trump has touted himself as a global peacemaker during his second term and his decision to weigh in behind Malaysian premier Anwar Ibrahim's mediation efforts led to Cambodian Prime Minister Hun Manet nominating him for the Nobel Prize, lauding his "extraordinary statesmanship".
At a ceremony during a summit of the Southeast Asian bloc ASEAN in Kuala Lumpur on Sunday, with a backdrop covered in US insignia and the words "Delivering Peace", Trump called the two leaders courageous, adding the truce he brokered saved "millions of lives".
"Because of America's strong commitment to stability and peace in this region and every region where we can do it, my administration immediately began working to prevent the conflict from escalating," Trump said, describing the agreement as a peace treaty.
"We just did the deal and reported the deal. Everybody was sort of amazed that we got it done so quickly," he said, noting that the United Nations was not involved.
Guns have been largely silent along the border, though both sides have frequently accused each other of ceasefire violations that the enhanced agreement seeks to prevent.
The two countries, in a joint declaration, committed to establishing an ASEAN observer team, military de-escalation and removal of heavy weapons from their border area, with Thailand agreeing to release 18 Cambodian prisoners of war if the measures were implemented.
They also agreed to co-ordinate on removing landmines, which were the trigger for the fighting after a Thai soldier was maimed during a border patrol.
Thailand has accused Cambodia, one of the world's most landmine-scarred countries, of laying new ordnance, which it denies.
"This declaration reflects our will to resolve differences peacefully in full respect of sovereignty and territorial integrity," Thai Prime Minister Anutin Charnvirakul said.
Hun Manet said it showed conflicts must be settled peacefully, "no matter how difficult or complex our dispute may be".
The agreement will be a feather in the cap for Trump, whose administration has this year been involved in mediation efforts in Gaza, between Armenia and Azerbaijan, and a brief conflict between India and Pakistan, while pushing to end Russia's war in Ukraine, which he has admitted has proven harder than he anticipated.