Thailand and Cambodia agreed to an “immediate and unconditional” ceasefire from midnight to end their five-day conflict, Malaysian prime minister Anwar Ibrahim announced on Monday.
Cambodian prime minister Hun Manet and Thailand’s acting prime minister Phumtham Wechayachai met at Mr Ibrahim’s residence in Kaula Lumpur where they hailed the outcome of the talks and shook hands after a brief press conference.
The two leaders also reached a common understanding to take steps to return to normalcy.
The agreement seeks to end the fierce clashes that erupted on Thursday after Cambodian and Thai forces traded gunfire, artillery and airstrikes across multiple places along their disputed land border.
The conflict killed at least 35 people and displaced more than 260,000 people on both sides.
The clashes erupted early on Thursday near Ta Moan Thom, an ancient temple complex straddling Thailand’s Surin province and Cambodia’s Oddar Meanchey.
Thai authorities claimed that fighting started after a drone and six Cambodian soldiers approached a Thai military outpost.

Troops from both sides failed to de-escalate and gunfire broke out. Thailand later deployed F-16 fighter jets to bomb what it called military targets inside Cambodian territory.
"We have used air power against military targets as planned," said Colonel Richa Suksuwanon, deputy spokesperson for the Thai Army.
The Cambodian defence ministry accused Thailand of dropping two bombs on a road and denounced the attack as “reckless and brutal military aggression” violating its sovereignty. "We have no choice but to respond with armed force against armed aggression," prime minister Hun Manet said.
Thailand’s foreign ministry said Cambodia had carried out heavy artillery strikes at a military base and struck civilian areas, including a hospital. "The Royal Thai government is prepared to intensify our self-defence measures if Cambodia persists in its armed attack and violations upon Thailand’s sovereignty," ministry spokesperson Nikorndej Balankura said.
A child was among three civilians injured in the border town of Kabcheing, Thai defence ministry spokesperson Surasant Kongsiri said. Authorities evacuated more than 40,000 residents from 86 villages near the frontier in Si Sa Ket and Surin provinces.
In Si Sa Ket, six civilians were killed when gunfire hit a petrol station. A total of 14 people were reported injured across three Thai border provinces.
Footage from Thai broadcasters showed women and children fleeing into sandbagged bunkers as explosions echoed in the background.

"How many rounds have been fired? It's countless," a woman told the Thai Public Broadcasting Service while taking shelter.
The escalation followed weeks of rising tensions. The previous week, a Thai soldier had lost his leg after stepping on a mine in a disputed zone near Ubon Ratchathani.
Thai officials accused Cambodia of recently laying new Russian landmines in breach of previous agreements. Phnom Penh denied the accusation, blaming legacy ordnance from its decades-long civil war, which left millions of landmines scattered across the country.
In the wake of the incident, Thailand withdrew its ambassador, expelled Cambodia’s envoy, and sealed all border crossings under the command of the country’s Second Army.
Cambodia retaliated by expelling Thailand’s ambassador and recalling its diplomatic staff from the Bangkok embassy.
A post by the Thai embassy in Phnom Penh warned citizens to avoid travel to Cambodia, unless absolutely necessary.

The fighting continued on Monday. Maly Socheata, a Cambodian defence ministry spokesperson, said the Thai assault was "ongoing and strong".
Gunfire was heard as dawn broke in Samrong in Cambodia’s Oddar Meanchey province, AP reported witnesses as saying.
Late on Sunday, Mr Ibrahim had expressed hope that both sides would present their conditions for peace but "what is important is immediate ceasefire”.
"I hope this can work," he was quoted as saying by Malaysian news agency Bernama. "Although it's not as bad as many other countries, we have to put a stop to the violence.”
Tensions have simmered since late May when a brief gunfight resulted in the death of a Cambodian soldier. The situation deteriorated when a leaked phone call between Thai prime minister Paetongtarn Shinawatra and Cambodia’s influential former leader Hun Sen caused a political crisis in Bangkok. Ms Shinawatra was subsequently suspended pending a court investigation into alleged ethics violations over her handling of the issue.
Border clashes between Thailand and Cambodia are nothing new. Disputes have persisted for more than a century along their 817km frontier, much of it poorly demarcated. A key flashpoint is the Preah Vihear temple, a 1,000-year-old Unesco World Heritage Site.
The International Court of Justice ruled in 1962 that the temple belonged to Cambodia but surrounding areas would remain a source of conflict, which escalated into deadly skirmishes in 2011. The court reaffirmed Cambodia’s claim in 2013 – fueling resentment in Thailand.