In a sign of escalating tensions in Southeast Asia, Chinese Foreign Minister Wang Yi just canceled a bilateral meeting with his Vietnamese counterpart, Pham Binh Minh. Since clashing in a brief war in 1979 and a naval battle in 1988, Vietnam has drawn China’s ire with some creative (and risky) diplomacy intended to counter Beijing’s acts of unilateral dominance in the South China Sea.

Last month, Hanoi agreed to back off of a major oil exploration venture in the South China Sea at Beijing’s behest. General Fan Changlong, deputy chair of China’s Central Military Commission, applied some heavy-handed pressure, including paying a visit to Madrid to raise Beijing’s concerns over Spanish corporation Repsol’s involvement in the deal despite Respol’s having already invested $300 million in the project. General Fan also traveled to Hanoi for an annual border exchange, during which time he directly requested that Vietnam cease oil exploration in the disputed zone, block 136-03, even threatening to use force if his request was denied. Hanoi then relented. Although many Asia analysts were critical of Vietnam’s decision, which they saw as kowtowing to Beijing, Hanoi has continued to push back against China in other important areas.

For instance, Vietnam has moved forward with construction of artificial land features in the South China Sea, which it began building in the 1980s. Yet Beijing, much to its ire, is unable to publicly condemn these moves without appearing hypocritical, as China has constructed seven islands in the South China Sea totaling over 3,200 acres of land and has continued to install more military hardware on them.

At the same time, Hanoi pushed ardently to include legally binding language in the draft framework for a South China Sea code of conduct, which the Association of Southeast Asian Nations and China recently signed at the ASEAN summit in Manila on August 7. The code of conduct would regulate regional states’ behavior in the South China Sea and aim to “promote mutual trust, cooperation and confidence, prevent incidents, manage incidents should they occur, and create a favourable environment for the peaceful settlement of the disputes,” according to a draft of the framework seen by Ian Storey, editor of Contemporary Southeast Asia. The draft, however, did not include any reference to “legally binding” mechanisms that would ultimately hold parties accountable.

Other ASEAN nations are now caught in the crossfire as the ten-nation group finds itself conflicted on how best to confront (or cede to) Chinese pressure. Malaysia voiced concerns over “the presence of military assets” in disputed waters, according to a draft statement. But the Philippines, which chairs ASEAN this year, has done far less to challenge China in the South China Sea compared with the previous administration of Benigno Aquino III, which filed the case against China with the Permanent Court of Arbitration in The Hague in 2013. Indeed, President Rodrigo Duterte has gone so far as to say that that same court’s later decision, which ruled in the Philippines’ favor, was “just a piece of paper with four corners.” Duterte has suggested that he is willing to negotiate bilaterally with Beijing to seek a deal in the South China Sea.

Vietnam now appears to be an outlier in its vociferous opposition to China’s push for control over the South China Sea. Although China’s population is more than 14 times Vietnam’s, and its military budget is $151 billion compared with Vietnam’s mere $5 billion, the smaller southern nation has a long history of pushing back against the powerful Middle Kingdom. For nearly a thousand years, the Chinese forcibly occupied and controlled their less powerful neighbor, throughout which time the Vietnamese fought to expel them. Today Hanoi is signaling that it will not change its position in order to safeguard Vietnam’s sovereignty claims and maritime domain.

Vietnam now appears to be an outlier in its vociferous opposition to China’s push for control over the South China Sea.

Integral to Vietnam’s strategy are its deepening defense ties with Washington, a former adversary. The Obama administration signed a comprehensive partnership with Hanoi in 2013, and Obama signed an end to the ban on lethal arms sales to the government of Vietnam in May 2016. Now the two erstwhile foes find their strategic interests in closer alignment, as the United States seeks to push back against China’s perceived expansionism and increased tolerance for risk. The Obama administration also forged strategic partnerships with the governments of Singapore and Malaysia, and the Pentagon rolled out the Maritime Security Initiative, a five-year, $425 million program to boost the domain awareness capacity of Southeast Asian states, particularly the Philippines, which received the bulk of the first year’s funds.

Observing the uptick in tensions between Washington and Beijing, analysts have had a field day with historical analogies to the “Thucydides trap,” a term coined by the Harvard scholar Graham Allison to describe the risk of conflict triggered when a rising power sets off a collision course with a reigning superpower. In Thucydides’ recounting of the Peloponnesian War, it was famously “the rise of Athens and the fear that this instilled in Sparta that made war inevitable.” Scholars such as Allison now explicitly debate whether China and the United States are destined to repeat the Thucydides trap and go to war.

Whether Vietnam’s defiance and Washington’s desire to bolster small states’ positions in the face of China’s rising power will lead to a new superpower conflict, only time will tell. But the emergence of a U.S.-Chinese war is still a distant and unlikely possibility. The two countries’ economies are deeply interdependent with extensive trade and investment ties, and they cooperate on a variety of global diplomatic initiatives, from the Paris climate deal to international sanctions on North Korea.

For now, Vietnam has displayed a tolerance for friction in its relationship with China (still its largest trading partner) in order to preserve its autonomy. Washington will have to remain sensitive to Hanoi’s concerns as well as the risks of being perceived as taking sides in the South China Sea dispute. The official U.S. position has been to remain neutral regarding territorial maritime claims and to uphold its desire for the peaceful settlement of all disputes. The United States, along with Japan and Australia, last week urged China and the Philippines to respect the ruling made by the Permanent Court of Arbitration last summer.

China’s rise will continue to spark a diverse array of behavior from smaller powers in Southeast Asia. Vietnam is exhibiting strategic patience and creativity in the face of major diplomatic pressure. And it is proving adept at navigating the complex competition between two rival superpowers. For example, after a 2014 dispute over a Chinese oil rig in Vietnam’s exclusive economic zone set off protests across Vietnam and anti-Chinese animosity, Vietnamese Politburo member Le Hong Anh paid a visit to Beijing to repair relations. In 2015, General Secretary Nguyen Phu Trong also preceded his historic visit to Washington, the first ever by a Vietnamese leader of his rank, with a trip to Beijing in April.

Hanoi’s resistance in the face of Chinese pressure has borne fruit in that it has shaped Beijing’s actions in the latter’s near backyard. Yet this raises the question of how much leverage Vietnam has over China. Given the overwhelming power disparity between the two, Hanoi’s success will depend in part on continuing to improve relations with outside powers, such as India, Japan, and the United States, all of which have been more engaged in the South China Sea in recent years.

But by showing its tolerance for risk and taking a firm stance on the South China Sea, Vietnam is sticking its neck out and managing to garner support from an international coalition to oppose Beijing. To those who endorse a more confrontational policy vis-à-vis Beijing, this is a welcome contrast with the Philippines’ policy of accommodation.