OPPOSITION troops have captured a town in central Myanmar that is a district administrative headquarters after beating back the military, the shadow government and local media said on Tuesday.

The shadow National Unity Government (NUG) hailed it as a key victory, although an analyst cautioned that the fighters may struggle to hold Kawlin, which has a population of around 25,000.

Myanmar's military is battling a surge in violence as forces opposed to it, including ethnic minority armies, have launched fresh attacks over two years after the generals unseated an democratically elected government in a 2021 coup.

Opposition troops attacked junta soldiers in Kawlin last week, before overpowering them on Monday and taking over the town, the NUG said.

Its defence ministry posted a video on social media of soldiers raising the flag of resistance groups aligned with the shadow government.

"A district level town is under our control now," NUG prime minister Mahn Winn Khaing Thann said on social media platform X. "What a groundbreaking victory!"

A junta spokesman did not respond to calls from Reuters.

The town fell after a small group of junta soldiers surrendered following fierce fighting, local media outlet Myanmar Now said, quoting a rebel fighter.

However, Richard Horsey, senior adviser for Myanmar at the non-profit International Crisis Group, said the resistance might find it difficult to maintain control over Kawlin.

"It's not that difficult to surge in and overrun a provincial town close to the mountains. But it will be difficult to hold it," he told Reuters.

A 28-year-old Kawlin resident, who declined to be named because of security concerns, said they left the town over the weekend after fierce fighting erupted between the rebels and junta soldiers backed by air support.

"Our neighbour's house was hit. There was no way to stay there safely," the resident said. "So almost everyone has left."

Resistance troops have taken over Kawlin's police station, district administrative office, bank and other key establishments, the NUG said.

The NUG, comprised of remnants of the administration of deposed leader Aung San Suu Kyi and others, has been engaging with democratic nations, including the United States, to rally support for its fight against the powerful military.

In a separate offensive, NUG said its troops and those of its allies had taken over another town in Sagaing division, where Kawlin is also located, in a district bordering India.

Besides the NUG, an alliance of ethnic minority armies late last month launched a series of surprise coordinated attacks on junta targets along areas abutting China.

Rights groups and U.N. experts have accused the military of committing atrocities against civilians in its efforts to crush the resistance. The junta says it is fighting "terrorists" and has ignored international calls to cease hostilities.