Cambodia welcomed and Thailand accepted a UN ruling Monday awarding most of the disputed border land around an ancient temple to Cambodia -- an issue which sparked deadly clashes in the past.
Nervous Cambodian residents had dug bunkers or evacuated homes earlier Monday in anticipation of trouble following the International Court of Justice ruling at The Hague, while many Thai schools along the border were shut for the day.
At least 28 people have been killed in outbreaks of violence since 2011 over the ownership of a patch of land next to the 900-year-old Preah Vihear temple.
The issue inflames nationalist sentiment in both countries -- not least because both governments, experts say, have used it to drum up support or as a distraction from domestic politics.
The UN's top court ruled that most of the area around the 11th century temple belongs to Cambodia and that any Thai security forces there should leave.
Despite the apparent blow, Thai Prime Minister Yingluck Shinawatra agreed to hold talks with Cambodia over the issue, adding she would protect her kingdom's interests.
"The government has asked the military... to take care of peace along the border," she said in a television address, reflecting the importance of the issue to patriotic Thais.
Tens of thousands of people were displaced in the fighting, leading Cambodia to ask the ICJ for an interpretation of the original 1962 ruling on ownership of the contested parcel of land.
Thailand does not dispute Cambodia's ownership of the temple, a UNESCO World Heritage site, but both sides claimed an adjacent 4.6-square-kilometre (1.8-square-mile) piece of land.
The ruling appeared to reach a compromise on the amount of land to be ceded by Thailand.
"We cannot say the verdict from the court today satisfies our goal 100 percent," said Cambodia's Foreign Minister Hor Namhong at The Hague.
"But we are happy... the verdict has rendered most of what we want."
The mood on both sides of Preah Vihear temple had been tense before the ruling.
"We have already prepared our bunkers in case Thai troops open fire," So Phany, a Cambodian vendor near the temple, told AFP.
Other villagers along the border with Thailand left their homes altogether, fearing the worst, said an AFP photographer at the scene.
Dozens of locals near the temple complex crowded around grainy television screens in coffee shops as the ICJ began the live broadcast of its deliberations.
The ruling has heaped further pressure on Yingluck's government, which is already grappling with mass street demonstrations against a controversial political amnesty bill.
The country's opposition is likely to direct any public anger over the ruling towards Yingluck, whose divisive brother Thaksin is close to Cambodia's strongman premier Hun Sen.
Cambodia has allowed Thaksin -- who is in exile from Thailand to avoid a jail term -- to hold a number of rallies for his "Red Shirt" supporters on its soil.
Last year the ICJ ruled that both countries should withdraw forces from around the ancient Khmer temple, which is perched on a clifftop in Cambodia but is more easily accessed from the Thai side.
Cambodia and Thailand finally pulled hundreds of soldiers from the disputed zone in July 2012, replacing them with police and security guards.
The roots of the dispute lie in maps drawn up in 1907 during French colonial rule.