China's deployment of a drilling rig in Vietnam's claimed exclusive economic zone in the South China Sea - which Vietnamese unanimously view as a violation of their sovereignty - has struck some dangerous chords in Vietnam.
The Vietnamese government gave its implicit support to May 11 rallies by thousands of anti-Chinese demonstrators in Hanoi, Ho Chi Minh City, and other locations across the country. Vietnamese leaders have rarely allowed such rallies to take place for fear they could be hijacked by anti-government forces, but this time demonstrators were focused exclusively on Beijing's recent aggressiveness.
Hanoi faces a dilemma. Diplomatic channels, including those between the two countries' communist parties, have been exhausted. Both sides have held working sessions since early May. But at the highest levels, President Xi Jinping reportedly refused to talk with Communist Party Secretary Nguyen Phu Trong.
The use of force is a non-starter. The military gap with China is simply too large, and any military action would undermine Vietnam's longstanding plea to resolve the South China Sea conflicts peacefully based on international law. On the economic front, a decision by Beijing to sever trade with Vietnam would effectively halt the country's manufacturing sector, which largely depends on Chinese supplies to make its final products.
The government's inability to come up with a clear-cut solution has prompted some to try to take matters into their own hands, transforming a foreign policy standoff into a domestic challenge.
Some Vietnamese seized the opportunity to advocate political reforms as the only means of affording Vietnam greater international support and leverage vis-à-vis China in the long run. These calls have been made in the past in a broader sense, but are being renewed in a slightly different light.
A number of Vietnamese have come to attribute the government's reluctance to stand up militarily or pursue international arbitration against China to the shared ideology between Hanoi and Beijing. A change in the type of government in Vietnam will, in their view, alter the dynamics of the Sino-Vietnamese relationship.
Meanwhile, other factions have resorted to violence targeted at Chinese-owned companies and nationals. Following peaceful protests by factory workers, mobs numbering in the thousands vandalised and burned down businesses they believed to be Chinese-owned at two industrial parks near Ho Chi Minh City. Most of those factories turned out to be owned by Taiwanese and Korean corporations.
The government did not deploy riot police and reestablish security until the day after the protests turned violent, when at least 15 factories had been set ablaze by extremist elements.
Vietnamese workers also went on a rampage against Chinese nationals employed at a steel mill in central Vietnam, leaving at least two Chinese dead and hundreds injured. Already, the damage to factories and reports of Chinese businesspeople fleeing Vietnam threaten the country's image in the eyes of foreign investors.
These developments have detracted attention from the core issue for Vietnam, which is how to peacefully manage tensions with China while making the case to Beijing that violating international law will not be in its long-term interests.
The Vietnamese government has, up until the current crisis, skilfully managed its differences with Beijing regarding the South China Sea. Immediately after its vessels were rammed by Chinese ships around the rig area, Hanoi mounted a formidable diplomatic campaign abroad with the goal of alerting the world of the blatant disrespect China showed towards its neighbours.
But communicating with the domestic public has proved trickier. In hindsight, the government's green light to demonstrators may have sent the message that in this context, any actions that can be justified as anti-Chinese are acceptable.
Giving anti-China protests the go-ahead might seem like a good idea, but cracking down once protests turn violent could put the authorities and demonstrating crowds on a collision course. Not all Vietnamese understand the complexity of Sino-Vietnamese relations and the position of their country with regards to the South China Sea disputes. Meanwhile, Beijing has accused of Hanoi of turning a blind eye to acts of violence against its citizens in Vietnam.
Due to the much more open nature of Vietnamese society in recent years, the government will increasingly find that its relations with China can no longer be a secretive, brotherly affair. Given recent developments, domestic considerations - trying to ensure the safety of foreign enterprises and finding a balanced approach to managing large anti-China protests - are now a critical piece of Hanoi's South China Sea puzzle.
Ms Phuong Nguyen is a Research Associate with the Sumitro Chair for Southeast Asia Studies at CSIS. This article first appeared on CogitASIA (http://cogitasia.com/), the blog for the Asia programmes at CSIS.