Thailand and Cambodia have agreed to an immediate ceasefire, the defense ministers of the two countries said in a joint statement on Saturday. Both sides have agreed to freeze all troop movements and allow civilians living in border areas to return home, halting weeks of intense border clashes that have killed at least 41 people and displaced almost a million people. The ceasefire took effect at noon local time (05:00 GMT). Once it has held for 72 hours, 18 Cambodian soldiers held by Thailand will also be released, the statement said. The breakthrough came after Thai and Cambodian officials held several days of talks aimed at ending fresh fighting between the two countries. The joint statement outlines the terms of 'de-escalation', which includes ceasing 'attacks on civilians, civilian objects and infrastructures, and military objectives of either side'. 'Both sides must avoid unprovoked firing or advancement or movement of troops towards the other side's positions or troops,' the statement said. The statement also noted that the release of the 18 Cambodian soldiers held by Thailand would be conducted 'in the spirit of the Kuala Lumpur Declaration', an agreement between the two countries signed at a ceremony attended by former US President Donald Trump in October. This ceasefire agreement was subsequently broken when fresh clashes erupted earlier this month, with both sides blaming each other for the breakdown.