Myanmar military. [AFP]

Myanmar troops have withdrawn from their positions in a trade hub near the Thai border, a spokesman for the junta said, confirming reports from an ethnic armed group that has been battling the military for days.

Fighting around the trading town of Myawaddy erupted earlier this week, with the Karen National Union (KNU) saying on Thursday that junta soldiers had left their posts.

Some 200 junta troops in the town had withdrawn and were sheltering on a bridge that connects Myawaddy to the Thai town of Mae Sot, KNU spokesman Padoh Saw Taw Nee told AFP.

Late Thursday junta spokesman Zaw Min Tun confirmed to local media that soldiers "had to withdraw" from their base, saying it was for their families' safety.

He said that the junta and Thai authorities were in discussion over the soldiers, but did not give any details about how many were involved.

"Regarding them, there has been negotiation between two countries," he told BBC Burmese.

He said that some KNU fighters had entered the town, but did not give any further details.

A KNU spokesman told AFP on Thursday it was likely the soldiers still had their weapons.

AFP has contacted the Thai government for comment.

Myanmar has been roiled with conflict since the army overthrew a democratically elected government in 2021, but the junta is facing its gravest threat yet after heavy losses in recent months.

In January 276 troops fled into India following clashes with an ethnic armed group in the west of the country.

A military plane sent to India to bring them back overshot the runway and crashed, injuring twelve people.