Thailand has released 18 Cambodian soldiers that were captured in July during deadly border clashes as part of a ceasefire the two countries agreed to on Saturday.

The handover was delayed by a day over Thai concerns over alleged violations of the ceasefire, but took place after sustained Chinese diplomatic pressure to ensure the deal holds.

Simmering tensions along the Thailand-Cambodia border exploded early this month and went on for weeks, forcing nearly one million people from their homes.

Saturday's deal saw both sides agree to freeze the front lines where they are now, ban reinforcements, and allow civilians living in border areas to return as soon as possible.

The 18 Cambodian soldiers, dressed in civilian clothes, were greeted by well-wishers as they were escorted over a border checkpoint and handed to the Cambodian authorities.

Their captivity since July - during an earlier round of deadly clashes - has inflamed nationalist sentiment in Cambodia, with their release being one of the main demands from its government in the ceasefire talks with Thailand.

On Wednesday, Thailand's foreign ministry stated that the release of the soldiers was a demonstration of goodwill and expressed hope that Cambodia would reciprocate this goodwill through concrete actions.

Cambodia confirmed the return of its troops and expressed hope that this would help build mutual trust and confidence.

Although the terms of the ceasefire stipulated that the soldiers must be handed over within 72 hours - by noon local time on Tuesday - this was postponed after Bangkok accused Phnom Penh of violating the truce by flying over 250 unmanned aerial vehicles into Thailand on Sunday.

Despite Thailand's complaints, the latest ceasefire appears to be holding so far.

Disagreement over the border dates back more than a century, but tension increased earlier this year when a group of Cambodian women sang patriotic songs in a disputed temple.

A Cambodian soldier was killed in a clash in May, and then in July, five days of intense fighting along the border left dozens of soldiers and civilians dead, displacing thousands more.

The two countries had agreed to a fragile ceasefire in July, signing it in October and brokered by US President Donald Trump. However, this ceasefire collapsed when new tensions erupted early this month, with both sides accusing each other for the breakdown.