Dec 15 (Reuters) - Generals from Myanmar's junta held peace talks in June near the border with China with representatives of three powerful ethnic armies. They sat across a wide table covered with blue cloth and decorated with elaborate bouquets.

But the rebels were playing a double-game. Secretly, the ethnic armies - collectively called the Three Brotherhood Alliance - had already laid the groundwork for Operation 1027, a major offensive launched in October that has become the most significant threat to the regime since it seized power in a 2021 coup.

"We were already preparing for the operation when we met them," said Kyaw Naing, a spokesman for the Myanmar National Democratic Alliance Army , a largely ethnic-Chinese group that is part of the rebel coalition. Reuters interviewed a dozen resistance officials with knowledge of the operation, as well as analysts and other people familiar with the matter. Some spoke on condition of anonymity because the offensive is ongoing. They disclosed previously unreported elements of the planning, including details of the formation of a unified battlefield brigade and the extent of China's impatience toward the junta, which some analysts believe emboldened the militias. Operation 1027, named after the date it began in late October, has delivered nationwide victories for the alliance and other groups fighting the military, which unseated Nobel laureate Aung San Suu Kyi's civilian-led government in February 2021. The junta cracked down on protests after the coup, sparking a grassroots rebellion and re-igniting conflict with some ethnic armies. The military, known as the Tatmadaw, has ruled Myanmar for five of the past six decades, and its soldiers are feared for their brutality and scorched earth tactics. The army says tough measures are required to fight groups it considers "terrorists."

Two members of the Three Brotherhood Alliance together with five other armed groups formed the new Brigade 611 in early 2022, four rebel officials told Reuters. The formation's strength numbers in the "thousands", one of them said. It was a display of unprecedented cooperation among outfits that come from different parts of Myanmar, speak different languages and traditionally have had different priorities, according to a November report from the U.S. Institute of Peace (USIP), a Washington-based think-tank focused on conflict prevention and resolution.

The operation came amid rising anger in Beijing with the junta over rampant crime on the border, which created conditions that supported the blitzkrieg, according to two analysts. China, a key junta ally that also has close relations with some ethnic Chinese militias in the borderlands, has been riled by Myanmar's inability to shut down online scam centres along the frontier that have become a scourge across Southeast Asia.

As of October, more than 20,000 people, mainly Chinese, were being held in over 100 compounds in northern Myanmar, where the workers - many of them trafficked - defraud strangers over the internet, according to a USIP estimate.

The centres have become a major public security challenge for China and Chinese officials delivered an ultimatum in Beijing this September to their Myanmar counterparts: eliminate the compounds or China would do so, according to a person briefed on their meeting. Numerous scam centres were caught up in the recent fighting, allowing many foreign nationals who had been trapped to flee. Myanmar's junta, as well as China's Ministry of Public Security, did not return requests for comment.

In a Nov. 29 speech, junta leader Gen. Min Aung Hlaing said the fighting near the border originated from long-standing issues and the military was focused on combating insurgents "for peace and stability in the region." The regime has since held China-facilitated talks with the Three Brotherhood Alliance, a junta spokesman said on Dec. 11 without providing further details. Beijing said it supports such talks, while the alliance said on Wednesday it remains determined to defeat the "dictatorship". A senior Chinese diplomat said in November that Beijing doesn't interfere in the internal affairs of other countries, but urged Myanmar to protect Chinese residents and personnel, and to cooperate in ensuring stability along the border.

China's Ministry of Foreign Affairs said in response to questions that it has deepened its cooperation with Myanmar on targeting telecoms fraud and that the campaign has been successful, with many suspects sent back to China.

"China will continue to severely crack down on transnational criminal activities such as cyberscams with relevant parties, and uphold order and tranquility in both countries' border regions," it added.

BRIGADE 611

Operation 1027 began in northern Shan State, abutting the border with China, where troops led by the Three Brotherhood Alliance - which comprises MNDAA, the Ta'ang National Liberation Army and the Arakan Army (AA) - said they captured around 150 military outposts, five towns and four border gates within a month.

Independent analysts consider those figures reliable and the junta, which has not addressed specifics about battlefield defeats, has acknowledged some loss of control.

Among the rebel forces was the multi-ethnic Brigade 611, said MNDAA's Kyaw Naing. The formation includes troops from entities supported by the parallel civilian government as well as fighters from the AA, one of Myanmar's most powerful ethnic armed forces, and the Bamar People's Liberation Army (BPLA), a newer militia drawn mostly from the country's majority Bamar people, officials from those groups confirmed.

Photos of Brigade 611 posted by an MNDAA-affiliated outlet in January show hundreds of troops in battle fatigues gathering for a graduation ceremony. Officials watched from a marquee, under a red banner with Burmese script and Chinese characters.

Some Brigade 611 troops drilled in using drones ahead of the operation, said BPLA spokesperson Lin Lin.

Rebel ground troops often launch attacks following drone strikes, a tactic that has "become a game changer" for them, said Khun Bedu, leader of Karenni Nationalities Defence Force (KNDF), which now controls parts of the frontier with Thailand and also contributed to Brigade 611.

The closer coordination means the rebels have risen "up everywhere and the junta doesn’t have enough military forces to handle them," said Zhu Jiangming, a security counsel at the Asian Development Bank who has written about the border situation.

Rebels aided by "foreign drone experts" used over 25,000 drone-dropped bombs during the offensive, forcing some military posts to be abandoned due to "excessive strength" of resistance fighters, Min Aung Hlaing said in November.

The Three Brotherhood Alliance did not respond to a request for comment on whether they used foreign experts.

Despite these setbacks, the Myanmar military - one of the largest in Southeast Asia - has sizeable resources and a "determination to prevail at all costs," said Richard Horsey, a senior adviser at the non-profit International Crisis Group.

Anti-junta operations have since rapidly expanded to other parts of Myanmar, with battles in the central region of Sagaing as well as in states near India and Bangladesh. In several areas, rebel groups are supported by the People's Defence Forces (PDF), a movement backed by the civilian National Unity Government (NUG) that includes representatives of Suu Kyi's administration.

The NUG claims control over parts of the country and has worked on diplomatically isolating the junta. Suu Kyi remains in detention in the capital, Naypyidaw.

In Mandalay, a major city that is the gateway to the northern territories, the local PDF is tasked with stalling military reinforcements to the frontline, its spokesman said. The NUG supports over 300 PDF units under its command using money raised by taxation, bond sales and other methods, Finance Minister Tin Tun Naing told Reuters.

CHINESE CHAGRIN

Chinese frustration had been steadily growing this year as the scam centres in northern Myanmar continued to operate despite Beijing's diplomacy, according to state media and online government posts. China's Ministry of Public Security heavily promoted social media posts on the arrests of alleged Myanmar scammers, gathering millions of views.

The Xinhua state news agency said the scam centres, many operated in enclaves run by junta-aligned forces, "seriously infringed on the property, security and legitimate rights and interests of the Chinese people." This summer, "No More Bets", a Chinese film about a couple from the country trafficked to a scam centre in an unnamed Southeast Asian country, grossed nearly $530 million domestically.

In recent months, Beijing raised the issue in multiple bilateral meetings, according to two people briefed on the talks and Chinese state media.

China exerts some influence over rebel groups, especially the ethnically Chinese, but does not control them, analysts say. Scot Marciel, a former U.S. ambassador to Myanmar, said the ethnic armed groups were not acting as Beijing's direct proxies in carrying out Operation 1027, "but the Chinese weren't troubled that they did it – at least the initial attacks on the scam centers".

Zhu, the Chinese security counsel, said China was friendly with both the junta and the resistance.

If two friends fight, he said, "I have no choice but to not help either side. But if anyone hurts China’s core interest, I will help its opponent."

(Reporting by Reuters staff; Editing by Katerina Ang)