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 Thailand-Cambodia border exploded early this month and went on for weeks, forcing nearly one million people from their homes.

Saturday's deal had seen 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, their release being one of the main demands of its government in the ceasefire talks with Thailand.

On Wednesday, Thailand's foreign ministry said the release of the soldiers was a 'demonstration of goodwill' and that it hopes Cambodia would 'reciprocate this goodwill through its concrete actions'.

Cambodia confirmed the return of its troops, with its defence ministry saying it 'remains hopeful' that this will help build 'mutual trust and confidence'.

One of the terms of the ceasefire was that the 18 soldiers had to be handed over within 72 hours - by noon local time on Tuesday. But this was delayed after Bangkok accused Phnom Penh of violating the truce by flying more than 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 early this year after a group of Cambodian women sang patriotic songs in a disputed temple.

A Cambodian soldier was killed in a clash in May. Then in July, five days of intense fighting along the border left dozens of soldiers and civilians dead. Thousands more civilians were displaced.

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