Updated

Mobs burned and looted scores of foreign-owned factories in Vietnam following a large protest by workers against China's recent placement of an oil rig in disputed Southeast Asian waters, officials said Wednesday.

The unrest at industrial parks near Ho Chi Minh City is the most serious outbreak of public disorder in the tightly controlled country in years. It points to the dangers for the government as it tries to manage public anger at China while also itself protesting the Chinese actions in an area of the South China Sea claimed by Vietnam.

Vietnam has sent ships to confront the rig which are engaged in a tense standoff with Chinese vessels protecting it.

The rioting Tuesday into Wednesday in Binh Duong province followed protests by up to 20,000 workers at the industrial parks. Smaller groups of men attacked factories they believed were Chinese-run, but many were Taiwanese or South Korean, the provincial government said in a statement.

On Wednesday morning, groups of men on motorbikes remained on the streets and factories in the area were closed, said a park manager who declined to give his name because of the sensitivity of the situation. Riot police were stationed around the area but men were still seen carrying looted goods, said a security guard, who also declined to be identified.

Firefighters battled to extinguish a fire at Tan Than Industries, a Taiwanese bicycle factory, where walls were toppled in the riots. Smoke poured out of blackened windows at other factories, as people waved Vietnamese flags while riding motorcycles through the streets.

Police said 440 people had been detained over the violence. Tran Van Nam, vice chairman of the Bing Duong government, said Chinese, Taiwanese and South Korean factories that hadn't already shut down had been asked to do so temporarily for the sake of public order. He said the "situation was now under control."

Taiwanese-owned athletic shoe manufacturer Yue Yuen, which makes shoes for Nike, Adidas and Reebok, said it had closed its three complexes close to Ho Chi Minh City as a precautionary measure. "We believe that this should be solved very soon, that somehow ultimately it will be up to the government authorities to guide the overall sentiment," company spokesman Jerry Shum said.

The Singapore government, which operates two industrial parks hit by rioters, called on Vietnam "to act immediately to restore law and order ... before the security situation worsens and investor confidence is undermined."

The security guard said looters stormed his factory at 1 a.m. and took computers and anything valuable.

"The whole industrial zone looks like it was just smashed by a typhoon," the guard said.

Another executive said many foreign-owned factories were putting banners on the gates of the factories saying, "We love Vietnam" and "Hoang Sa, Truong Sa - Vietnam," using the Vietnamese names for the Paracel and Spratly islands claimed by both Vietnam and China.

The government said the protests were initially peaceful but were hijacked by "extremists" who incited people to break into the factories. It said at least 15 factories were set alight and hundreds more vandalized or looted.

China's Foreign Ministry and its embassy in Hanoi issued warnings to Chinese citizens and urged Vietnam's government to protect them. The embassy's website said it saw no end to attacks by what it called anti-China forces and urged Chinese to take safety precautions and avoid unnecessary travel.

Low wages have attracted foreign investors from across the world to Vietnam in recent years.

In 2013 Chinese invested $2.3 billion, a sharp rise from the previous year, according to the Ministry of Planning and Investment. The country is also Vietnam's biggest trading partner, exporting billions of dollars of materials each year for factories producing goods including clothes, shoes and smartphones.

Vietnam reacted angrily after China towed a deep-sea oil rig on May 1 close to the Paracel Islands, which are controlled by China but claimed by Hanoi. It sent a flotilla of vessels to try to disrupt the oil rig. Some of the Vietnamese boats clashed with Chinese ships sent to protect the rig, raising fears of a possible conflict.

China has shown no signs of backing down, and accused Vietnam on Wednesday of "hyping" the issue.

"We urge Vietnam to stop all provocative actions, come to their senses, and stop all acts intended to create disturbances," Foreign Ministry spokeswoman Hua Chunying said.

The standoff underlines China's aggressive pursuit of its territorial claims despite complaints from smaller nations such as Vietnam and the Philippines, which also claim parts of the waters. The United States, a treaty ally of the Philippines, has called the latest Chinese action "provocative."

Over the weekend, the Vietnamese government gave rare permission for street protests against China in cities across the country.

The protests were enthusiastically covered by the state media, unlike the ones on Tuesday, which appear to have been hit by a media blackout.

The ruling Communist parties in China and Vietnam maintain close links and until May 1 had been trying to handle tensions over the territorial disputes quietly. Vietnamese authorities are normally highly nervous about spontaneous public gatherings of any sort. Many of the leaders of the anti-Chinese protests are also calling for basic democratic reforms, presenting a challenge to one-party rule.

Last month, the Philippines protested China's efforts to reclaim land in a disputed reef in the South China Sea after surveillance aircraft took pictures of dredging by Chinese vessels at Johnson Reef in the Spratly Islands, which the Philippines says violates a regional non-aggression pact, Foreign Secretary Albert del Rosario said.

Del Rosario told The Associated Press that it's not clear what China intends to build on the reef, which Manila claims as part of its western province of Palawan, but one possibility is an airstrip. Another official said China could also build an off-shore military base.