Cambodia and Thailand have agreed to withdraw their troops from a disputed border area near the ancient temple of Preah Vihear.
A territorial dispute over a patch of land around the temple has sparked a number of clashes between them.
Fighting in April left 18 people dead and tens of thousands displaced.
The International Court of Justice ordered both sides to remove troops from the disputed area in July - but neither has complied.
The deal was reached after Thai Defence Minister Yuthasak Sasiprapha met his Cambodian counterpart, Tea Banh, in Phnom Penh.
According to a joint statement, both countries agreed to set up a working group.
The statement added the withdrawal will take place in the presence of Indonesian observers, according to AFP.
Thailand does not dispute Cambodia's ownership of the temple, but both sides claim some of the surrounding area.
Tension had been increasing between Cambodia and Thailand since UNESCO awarded World Heritage status to Preah Vihear in 2008.
In April 2009, troops exchanged fire across the border. More serious trouble flared in February 2011, when at least eight people were killed in several days of fighting.