While fighting ended soon after with a quick defeat for the rebels, Myanmar's decision to launch the attack so near the Chinese border was seen as a snub to Beijing by some analysts.
"The Chinese have learned that the Burmese regime are not as compliant as they assumed," said Monique Skidmore, an expert on Myanmar at Australia's University of Canberra. Myanmar is also known as Burma.
More than 30,000 civilian refugees had streamed into China to escape the fighting, which broke out last week after hundreds of Myanmar soldiers moved into Kokang, an ethnically Chinese region in northeastern Myanmar that borders China's Yunnan province.
Myanmar is trying to consolidate control over several armed ethnic groups along its borders to ensure smooth conditions for next year's national elections, the first in nearly 20 years. Several groups are resisting pressure to become border guards ahead of the vote.
The area is on the fringe of the drug-producing Golden Triangle region where Myanmar, Thailand and Laos meet, and much of the heroin and amphetamines produced there is smuggled into China where its sale funds the ethnic militias.
China has been working closely with Myanmar to stem the drug trade and is anxious to ensure that the other symptoms of the region's unrest - like high crime rates and casinos - stay on Myanmar's side of the border.
Beijing's desire for stability along that border is partially behind its nearly unwavering support for the generals who run Myanmar, despite international concerns about the authoritarian regime, said Donald Seekins, a Myanmar expert at Meio University in Japan.
"Beijing is not 100 percent happy with the military regime, but it sees no viable alternative and will do everything it can to restore stability in the border area - including intensive negotiations and behind-the-scenes pressuring of the parties involved," he said.
On Monday, hundreds of refugees who've spent at least the past week in China were transported from camps to the border, where they walked through the gate, clutching bags and blankets. Yunnan provincial government spokesman Li Hui said at least 4,000 refugees had returned to Myanmar by the end of the day Monday. About 9,000 remained in seven camps set up to house them in tents and makeshift buildings. The rest are believed to be staying with friends and family, or are staying in hotels, or have left the area.
In addition to the thousands of civilians, hundreds of Kokang rebels fled during the fighting, surrendering their weapons and uniforms to Chinese border police and crossing to safety after several days of skirmishes.
Myanmar's junta said three days of clashes killed 26 government soldiers and at least eight rebels. It said Sunday night that the fighting had ended and "the region has now regained stability."
Since abandoning overt support for anti-government rebels two decades ago, China has built strong relations with Myanmar's ruling junta while Chinese investors, traders, and shopkeepers have swarmed into the country's northeast.
The relationship has thrived through a tacit agreement under which Beijing provides economic opportunities and diplomatic support for the generals, who have been isolated internationally and face widespread condemnation over their human rights record and economic mismanagement.
In return, the generals ensured access to the country's mineral wealth and tried to address China's concerns over narcotics and unrest.
China's Foreign Ministry had no comment on the situation Monday, and Chinese government-backed scholars dismissed the notion of a major rupture in ties.
"China will develop friendly relations with Myanmar taking the overall situation into consideration," said Ma Ying, a professor at the Shanghai Institute of Foreign Studies.
But the clashes could threaten China's traditional arrangement with Myanmar, analysts say.
The conflict highlights the "imperviousness of the Burmese regime to international opinion, and the limitations of even China... to have much influence in a crunch," said Sean Turnell, a Myanmar expert at Australia's Macquarie University.