China has told Myanmar to put an end to fighting with an ethnic militia that has sent 10,000 people fleeing across their border, a strong response underscoring the communist country's concerns about potential instability.

People were continuing to cross from Myanmar's Kokang region into China's Yunnan province late Friday, according to eyewitnesses reached by phone. Sounds of artillery and gunfire across the border in Myanmar rang out throughout the day, they said.

Chinese authorities were housing the new arrivals at seven locations and providing medical services, according to a Yunnan government statement.

In Beijing, Foreign Ministry spokeswoman Jiang Yu said China hopes Myanmar can "properly deal with its domestic issue to safeguard the regional stability in the China-Myanmar border area."

Myanmar must also ensure the safety and legal rights of Chinese citizens in that country, Jiang added in a statement posted on the ministry's Web site.

China maintains close ties with Myanmar's ruling military junta and usually takes care not to entangle itself in the regime's affairs. Beijing has consistently offered Myanmar diplomatic support based on its avowed policy of nonintervention, while China's border trade and oil and gas deals have thrown an economic lifeline to the ruling generals.

Pak K. Lee, an expert on Myanmar and China at Kent University, said Beijing was not changing its noninterventionist stance, but was genuinely concerned about the fighting's effect on stability in Yunnan ahead of the highly sensitive Oct. 1 celebration of the 60th anniversary of the founding of the People's Republic.

"Absent the factor of the 60th anniversary, China might adopt a low-profile approach to the event. But now, it has to call on Myanmar to take prompt action to tackle the problem before it becomes unmanageable," Lee said.

Details of the fighting in Myanmar were murky, although reports say militants who have long fought for autonomy for Myanmar's ethnically Chinese Kokang minority attacked police near the town of Laogai on Thursday, killing several officers.

Myanmar's military rulers and the state-controlled press made no comment on the situation.

Myanmar's central government has rarely exerted control in Kokang — a mostly ethnic Chinese region in the northern Shan state — and essentially ceded control to a local militia after signing a cease-fire with them two decades ago. The region is one of several areas along Myanmar's borders where minority militias are seeking autonomy from the central government.

But tensions between the government and the Kokang people have been rising in recent months, as the junta tries to consolidate its control of the country and ensure stability ahead of national elections next year — the first since the opposition National League for Democracy won by a landslide in 1990, a result the military ignored.

Kokang lies 1,400 miles southwest of Beijing and is surrounded by lush mountains in a region notorious for the production and use of heroin and methamphetamines, cross-border smuggling, gambling and prostitution.

The region's links to China date back to the collapse of the Ming dynasty 350 years ago, when loyalists fled across the mountains into present-day Myanmar to escape Manchu invaders.

In recent years, the area has attracted a flood of businessmen from China who have opened hotels, restaurants and shops selling motorcycles, electronics and other imports that are either pricey or unavailable in other parts of Myanmar.

Wary of the consequences of renewed conflict, many of those investors fled back across the border this month, according to Chinese reports.

As the refugees poured in from Myanmar on Friday, Chinese authorities housed them in unfinished buildings, some still with no windows, said a local factory manager in the border town of Nansan who would only give his surname, Li.

A worker with an international medical charity, who asked not to be named for fear of reprisals from the local government, said local authorities were caring for about 4,000 refugees. Several thousand more were staying in hotels or with friends and family on the Chinese side, he said.

The latest confrontation apparently began earlier this month after militia leaders refused to allow their guerrillas to be incorporated into a border guard force under Myanmar army command.

Soldiers raided the home of militia leader Peng Jiashen on Aug. 8, and Peng's forces began mobilizing. Peng's troops were forced out of Laogai on Tuesday by government soldiers and a breakaway Kokang faction seeking to overthrow Peng.

China itself has taken a hard line against minority activists in Xinjiang and Tibet, crushing anti-government protests with overwhelming force, and Beijing has in the past said that Myanmar's policies toward minorities wasn't a concern.

However, analysts said the involvement of ethnic Chinese and Chinese citizens, and fears over border security, severely complicated matters for the government, prompting the strong statement.

"China has a difficult time trying to reconcile its very firm issues of sovereignty while protecting its people abroad," said Drew Thompson, a China expert at the Nixon Center in Washington who has traveled in the border region.

While China is not dictating to Myanmar how they should manage minorities or manage the border area, it is "trying to urge Myanmar's government to stop causing this problem," Thompson said.

Myanmar is one of several Chinese neighbors that pose border issues.

China has long based army troops along its frontier with North Korea, whose devastated economy is dependent on Chinese aid and isolated regime is under U.N. sanction for pursuing nuclear weapons. Terrified of a mass influx of starving refugees, China regularly rounds up and returns North Koreans who make it across the heavily guarded border while opposing stricter sanctions on the country that could push the regime toward collapse.

In the west, China borders former Soviet republics in Central Asia, most of them hotbeds of poverty and religious extremism. China also shares a narrow border with Afghanistan and a much longer one with Pakistan, whose government is battling a stubborn radical Islamic insurgency.

China's border with India to the south remains in dispute and considerable mistrust lingers between the sides, who fought a brief but bloody war over the frontier in 1962.

Those issues strongly influence Chinese defense planning, with peripheral security its No. 2 security concern, right behind maintaining domestic stability, Thompson said.

"The border is where internal security and external security meet," Thompson said.