Thailand and Cambodia have agreed to an “immediate and unconditional ceasefire” with effect from midnight on Monday, AP reported, quoting Malaysian Prime Minister Anwar Ibrahim.

The agreement was reached during a meeting that Ibrahim, Cambodian Prime Minister Hun Manet and Thai Acting Prime Minister Phumtham Wechayachai attended, according to Reuters.

The border conflict between Thailand and Cambodia – said to be the worst in 13 years – began in May after a Cambodian soldier was killed during a clash. The crisis escalated on Wednesday after a land mine explosion injured five Thai soldiers.

The fighting involved heavy artillery, air strikes and rocket fire across several disputed border areas.

At least 36 persons were killed amid escalated tensions and more than 3,00,000 have been displaced, reported Reuters.

This marked a sharp escalation in a long-running dispute between the countries that contest several stretches of land along their border. At least 28 persons had died in previous clashes between 2008 and 2011.

The ceasefire talks between Bangkok and Phnom Penh were hosted by Ibrahim in his capacity as the head of the Association of Southeast Asian Nations regional bloc for 2025.

After Monday’s meeting, the Malaysian prime minister said both sides had agreed to take steps to return to normalcy. He added that he was ready to deploy a team to ensure implementation of the agreement.

“This is a vital first step towards de-escalation and the restoration of peace and security,” Ibrahim said during a press conference. “All parties shared a commitment to peace.”

As part of the ceasefire deal, the defence ministers of Malaysia, Cambodia and Thailand have been instructed to “develop a detailed mechanism” to implement and monitor the agreement, added Ibrahim.

He also stated that military commanders from Bangkok and Phnom Penh will hold talks from Tuesday to defuse tensions. Cambodia is also scheduled to host a border committee meeting on August 4, added the Malaysian prime minister.

The Cambodian prime minister said that the solutions proposed by Ibrahim “will set the conditions for moving forward with bilateral discussions, returning to normalcy, and forming the foundation for future de-escalation”, reported Reuters.

On Sunday, United States President Donald Trump said that he had spoken to the Cambodian prime minister and the Thai acting prime minister.

Trump claimed he had told both leaders that Washington would not conclude trade deals with them unless they ended the fighting.

Both Cambodia and Thailand are facing a tariff of 36% on their goods in the US.

After the ceasefire agreement, Trump claimed Washington had “solved the war with trade”.