Members of the Myanmar military take part in a parade to mark the country's 78th Armed Forces Day in Naypyidaw on March 27, 2023.
In a matter of days the military government in Myanmar has lost control of much of its border with China.
A co-ordinated attack by three ethnic insurgent armies in Shan State, supported by other armed groups opposing the government, has overrun dozens of military posts, and captured border crossings and the roads carrying most of the overland trade with China.
It is the most serious setback suffered by the junta since it seized power in February 2021. After two-and-half years of battling the armed uprising it provoked with its disastrous coup, the military is looking weak, and possibly beatable.
The government has responded with airstrikes and artillery bombardments, forcing thousands of people to leave their homes. But it has been unable to bring in reinforcements or recover the ground it has lost. Among hundreds of troops killed is believed to be the commander of government forces in northern Shan State, Brigadier General Aung Kyaw Lwin, the most senior officer killed in combat since the coup.
What makes this attack even more significant is that it marks the first time that the well-armed insurgents operating in Shan State have explicitly aligned themselves and their military operations with the wider campaign to overthrow the junta and restore democratic rule.
However, there are other factors at play. These three insurgent groups have long-held ambitions to expand the territory they hold. And crucially China, which normally acts as a restraining influence on all the groups along its border with Myanmar, has not prevented this operation from going ahead.
That is probably because of its frustration over the military government's inaction over the scam centres which have proliferated in Shan State. Thousands of Chinese citizens and other foreigners have been forced to work in these scam centres. The insurgents say one of their aims is to close them down.
This long exposure picture taken late on October 28, 2023 shows a missile fired from a Myanmar military base in Lashio township, northern Shan State. Heavy fighting between rebels and the Myanmar military stretched into a second day near the country's northern border with China, armed groups said on October 28, 2023
Back in 2021, when peaceful protests against the coup were violently crushed by the military and police, opposition activists decided they had no choice but to call for a nationwide armed uprising against the junta.
Many fled to areas controlled by ethnic insurgents along Myanmar's borders with Thailand, China and India, where they hoped to get access to the training and weapons most of them lacked.
Some well-established ethnic armies, like the Karen, the Kachin, the Karenni and Chin, decided to ally themselves with the National Unity Government (NUG), which was set up by the elected administration that was deposed by the coup.
Others did not, notably the various groups in Shan State, a huge, lawless region bordering Thailand and China.
Perhaps best known as one of the world's biggest producers of illicit narcotics, Shan State has also recently begun hosting a booming business in casinos and scam centres.
It has been blighted by conflict and poverty since Myanmar's independence in 1948, fragmented into the fiefdoms of different warlords, drug bosses or ethnic rebels who have been fighting each other and the army.
Map showing territories held by various armies
Two rival insurgent forces claim to represent the Shan, the largest ethnic group, but in recent years four smaller ethnic groups have built up powerful armies.
The strongest of all of them are the Wa, with sophisticated modern weapons and around 20,000 troops backed by China.
Then there are the Kokang, an ethnically Chinese group with a long tradition of insurgency; the Palaung, or Ta'ang, people of remote hilltop villages whose army has grown rapidly since its formation in 2009; and the Rakhine, who are actually from Rakhine State on the other side of Myanmar. But they have a large migrant population in the east of the country which helped establish the Arakan Army, now one of the best-equipped forces in Myanmar.
The Wa agreed a ceasefire with the Myanmar military back in 1989, and have generally avoided armed clashes. They say they are neutral in the conflict between the junta and the opposition. But they are presumed to be the source of many of the weapons heading to the anti-military resistance groups in the rest of the country.
The other three ethnic armies - the Kokang MNDAA, the Ta'ang TNLA and the Arakan Army - have formed themselves into what they call the Brotherhood Alliance. They have all clashed repeatedly with the military since the coup, but always over their own territorial interests, not in support of the NUG.
These three insurgent groups have discreetly given sanctuary, military training and some weapons to dissidents from other parts of Myanmar.
But, situated as they are on the Chinese border, they have also had to consider China's concerns, which are to keep the border stable and trade flowing. China has been giving diplomatic support to the junta and kept its distance from the NUG.
Women holding banners, emergency flare sticks and fire sticks as they march during a demonstration against the military coup in Yangon on July 14, 2021.
In June this year, under pressure from China, the Brotherhood Alliance agreed to join peace talks with the military, although these quickly broke down. But they still appeared to be staying out of the wider civil war.
The operation they launched on 27 October has changed that.
They have made dramatic progress. Entire army units have surrendered without a fight. The alliance say they have taken more than 100 military posts, and four towns, including the border crossing at Chinshwehaw, and Hsenwi, which straddles the road to Muse, the main gateway to China.
They have blown up bridges to prevent military reinforcements from being brought in, and have surrounded the town of Laukkaing, where many scam centres are run by families allied to the junta.
Thousands of foreign nationals are believed to be trapped in Laukkaing, where there is growing chaos as people queue for the limited food left in the town. China has warned all its citizens to evacuate via the nearest border crossing.
The Brotherhood Alliance say their ultimate goal now, like that of the NUG, is to overthrow the military government.
The NUG, whose volunteer fighters have been waging a desperately unequal armed struggle against the full might of the army and air force, has applauded the alliance's success, and talked about a new momentum in their struggle.
Pro-NUG People's Defence Forces, which are not as well-armed or experienced as the Shan insurgents, have launched their own attacks in areas near Shan State to take advantage of the military's apparent weakness, and have for the first time captured a district capital from government forces.
The Brotherhood Alliance timed their attack carefully, right after an incident in Laukkaing which snapped China's patience with the junta.
For the past year the Chinese government has been pressing the military government to do more to shut down the scam centres, which are largely run by Chinese syndicates. They have become an embarrassment to Beijing after widespread publicity about the brutal treatment of the trafficking victims trapped in them.
Chinese pressure persuaded many of the Shan groups, like the Wa, to hand people suspected of involvement in the scams to the police in China. More than 4,000 were sent over the border between August and October. But the families in Laukkaing balked at shutting down a business which had been generating billions of dollars a year for them.
Sources from the area have told the BBC that there was then an attempt to free some of the thousands of people held in Laukkaing on 20 October, which went wrong.
Guards working for the scam centres are believed to have killed a number of those attempting to escape. That resulted in a strongly worded letter of protest being sent by the municipal government in the adjacent Chinese province demanding that those responsible be brought to justice.
The Brotherhood Alliance saw their opportunity and attacked, promising they would shut down the scam centres to assuage China. China has publicly called for a ceasefire, but alliance spokesmen say they have received no direct request from the Chinese government to stop fighting.
But their longer term aim is also to gain as much ground as they can, in anticipation of a potential collapse of the military government. This would put them in the strongest possible position for the negotiations, promised by the NUG if the junta is overthrown, on a new federal structure for Myanmar.
The TNLA has long wanted to expand the area it controls beyond the small Ta'ang self-administered zone allotted to them in the constitution.
The MNDAA wants to recover the control of Laukkaing and the adjacent border which it lost in a military operation in 2009, one led by none other than Myanmar's military chief General Min Aung Hlaing.
And everyone is watching the Arakan Army. It has so far only been supporting the fighting in Shan State. If it chooses to attack the military in Rakhine State, where it has most of its forces and already controls many towns and villages, the junta would find itself dangerously overstretched.
As a TNLA spokesman told the BBC, his group no longer sees any value in negotiating with the military government because it lacks legitimacy.
Any deal they strike would be invalidated by a future elected government. The Ta'ang, the Kokang and the Wa share the goal of winning constitutional recognition of statehood for their people within a new federal system.
In joining the fight these groups may help bring an end to military rule in Myanmar. But their aspirations, which are bound to conflict with the interests of other groups in Shan State, are a portent of the many challenges which will confront those trying to map out a democratic future for Myanmar.
Source: BBC