Cambodia and Laos reached an agreement for Lao soldiers to pull back from their shared border, easing the threat of a military confrontation.

The announcement came after Prime Minister Hun Sen flew to Vientiane on Saturday to hold urgent talks with Lao Prime Minister Thongloun Sisoulith.

Hun Sen on Friday dispatched forces to the border and issued an ultimatum for Laos to withdraw the soldiers.

In a news conference after the meeting, the Lao leader said he had ordered the withdrawal.

"I've ordered the authorities involved to withdraw troops from that area by tomorrow morning," Thongloun said.

Thongloun said he was sorry he had not responded to an August 2 letter from Hun Sen seeking the troop pull back.

"Anyway, the discussion today was frank and friendly, so that the area would not lead to forces being confrontational," he said.

Thongloun did not say whether Laos admitted to having sent troops into Cambodia, which says about 30 soldiers from Laos crossed into its province of Stung Treng in April.

Hun Sen said he had also ordered truck-mounted rocket launchers and ground troops to pull back in response to Laos' agreement to withdraw.

"Our biggest success is that there is no dispute that can't be solved," Hun Sen. "Moments ago, I already ordered all troops that were mobilised yesterday to go back to their positions."

Laos wants Cambodia to stop clearing land along the border for road-building and allow checks by inspection panels from both countries.