Updated

Vietnam forcibly broke up anti-China protests on Sunday after deadly riots targeting Chinese interests over a raging territorial dispute spooked investors and the country's authoritarian regime.

Bejing said it has evacuated 3,000 nationals from Vietnam and was sending the first of five ships to pull out those still at risk.

China's decision to deploy an oil rig to a disputed patch of the South China Sea on May 1 triggered fury in Vietnam and the worst breakdown in ties between Hanoi and Beijing in years. Hanoi sent patrol ships to confront the rig and scores of Chinese vessels protecting it, and they remained locked in a tense standoff.

Last weekend, Vietnam allowed anti-China protests that drew thousands of people, a rare step widely seen as a way of amplifying state anger against Beijing. Doing so was risky for authorities: dissident groups joined the protests, and by Tuesday and Wednesday, the rallies had morphed into riots targeting factories believed to be owned by Chinese companies. Many of those hit were Taiwanese. Two Chinese nationals were killed and more than 100 wounded.

Vietnam's state-security apparatus on Sunday ensured no one was able to protest.

In southern Ho Chi Minh City, police dragged away several demonstrators from a park in the city center. In Hanoi, authorities closed off streets and a park close to the Chinese Embassy, while police barking into bullhorns shoved journalists and protesters away. Police were posted outside well-known dissidents houses, preventing them from leaving, according to activists.

"I want to send a message that if we don't stop China today, tomorrow it will be too late," said demonstrator Dao Minh Chu, as he was pushed away from the park near China's embassy, where last week around 500 people gathered without interference from authorities. Those protests were covered enthusiastically by state media, a clear sign of state sanction.

China has loudly demanded that Hanoi protect Chinese people inside Vietnam, which is heavily dependent on Beijing economically. Hundreds of Chinese have left by commercial flights and across the land border into Cambodia, although there has been calm since Thursday.

On Sunday, China said it dispatched to Vietnam a passenger ship capable of carrying 1,000 people, the first of five vessels it planned to send to complete an evacuation on top of 3,000 nationals who had left earlier.

With Chinese travelling in increasing numbers, Beijing is under pressure to protect them overseas.

A Taiwanese steel mill attacked on Wednesday employed 1,000 Chinese workers, who can be cheaper to hire and easier to manage than Vietnamese laborers.

Yang Yang, a political scientist at the China University of Political Science and Law in Beijing, said there were so many Chinese working in Vietnam that sending ships was more practical than planes. "It can also appease the unhappiness of the Chinese public over the violence against Chinese nationals in Vietnam," he said.

In recent years, foreign companies attracted by low wages and a reputation for safety have flocked to Vietnam, opening factories making everything from sneakers to smartphones. The government is aware that last's week violence threatens that vital economic cog, as well as chipping away at its authority by showing it can't keep order — an important part of its compact with a population denied basic rights.

On Saturday, top Vietnamese security official Lt. Gen. Hoang Kong Tu vowed to ensure the safety of all foreign investments and citizens in the country, including those from China. More than 1,000 people have been arrested in connection with the violence, which authorities have blamed on "extremists."

China and Vietnam have growing business links and share a political ideology and a commitment to authoritarianism, but they also have a long history of bad blood. Many Vietnamese harbor deep resentment over what they see as China's bullying and economic exploitation of Beijing's far smaller neighbor.

China has been much more assertive in pressing its territorial claims in recent years, often bringing into it into dispute with Vietnam and the Philippines. Spats have broken out over fishing rights and oil exploration missions in recent years, but the placement of the rig 220 kilometers (136 miles) off the coast of Vietnam was considered especially provocative.

Vietnam's government routinely arrests free speech activists and others challenging one-party rule. Anti-China protests are one of the few opportunities for public gatherings in Vietnam and also attract dissident groups, who often claim Hanoi is too soft on Beijing.

Several well-known activists said they had been prevented from leaving their homes on Sunday.

"I think the best way is to allow people to protest," said La Viet Dung, a frequent anti-China protester, adding that police visited him late Saturday asking him not to attend. "They say they are preventing people from protesting because they are worried about extremist actions and violence, but that is not logical."

___

Dinh reported from Ho Chi Minh City. Associated Press writer Louise Watt and news assistant Henry Hou in Beijing contributed to this report.