The ruling by the International Court of Justice, ICJ, in The Hague said the area had been the scene of armed clashes between the two countries and there were concerns that the violence may reoccur.
The court also urged the two countries to continue to work with the Association of Southeast Asian Nations, ASEAN, to come to an agreement allowing obsevers respresenting the 10-nation block to access the provisional demilitarised zone around the temple.
Thailand’s Foreign Minister Kasit Piromya has said his country will honour the court’s ruling.
In April, Cambodia launched a legal battle before the ICJ asking for an interpretation of a 1962 court ruling around the 900-year-old Preah Vihear temple.
Thailand does not dispute Cambodia’s ownership of the holy site, secured by the 1962 ruling, but both countries claim the 4.6 square kilometre area surrounding the Khmer complex.
In February, the UN appealed for a permanent ceasefire after 10 people were killed in fighting near the temple. Fresh clashes broke out in April further west, leaving eight people dead and causing more than 85,000 civilians to flee the area.
The UN's highest court also ordered Thailand not to obstruct Cambodia's free access to the Preah Vihear complex or prevent Cambodia from taking fresh supplies to its non-military personnel there.
Cambodia said although there had been clashes in the past, Thai aggression substantially increased after July 2008, when the UN's cultural body Unesco listed the temple as a World Heritage site.