The arrival on Monday of the USS Carl Vinson illustrates Hanoi's complex and evolving relationship not only with Beijing over the disputed South China Sea but also Washington, D.C.
For months now, Vietnamese envoys have been working to ease the concerns of their giant Chinese neighbor over the visit, and the prospect of broader security co-operation between Hanoi and Washington, according to diplomats and others familiar with discussions.
The USS Vinson's visit to Vietnam, as well as President Donald Trump's increasingly good relations with Chinese Premier Xi Jinping, could signal Washington's becoming a mediator between the two Asian nations, especially in connection to their South China Sea disputes.
President Trump recently commented on Beijing's move to eliminate term limits, making Xi a life-time president.
"He's now president for life," the US president said, eliciting chuckles from the crowd. "And look, he was able to do that. I think it's great."
He garnered even more laughs when he quipped: "Maybe we'll have to give that a shot someday."
Vietnamese diplomats and military officers have repeatedly stressed the country's independent foreign policy and its desire for broad foreign relations - hoping to maintain stable ties with China while standing up to it over the South China Sea, the sources said.
The Vinson will mark the biggest U.S. military presence in the country since 1975 when it berths in Danang for a five-day stay.
The port city on Vietnam's central coast is close to its Blue Whale gas field, now being developed by U.S. oil major Exxon Mobil, as well as the increasingly fortified Paracel islands, which China occupies and Vietnam also claims.
China's rapid construction and build-up of the seven features it holds in the disputed Spratly group further south has alarmed Vietnam and other regional governments.
As it seeks to enforce its claims to much of the South China Sea, China's navy and coastguard now routinely patrol vast swathes of the area through which some $3 trillion in trade passes annually.
While some Chinese commentators have used the Vinson's presence to demand an even greater Chinese military bu
ild-up in the waterway, the official reaction from Beijing has been relatively muted since the stop was confirmed in January.
U.S. carriers frequently ply the South China Sea as part of a rising pattern of naval deployments, and are now routinely shadowed by Chinese naval vessels, regional naval officers say.
"Even as it moves forward with the U.S., Vietnam has been engaging China over South China Sea tensions," said Le Hong Hiep, a Vietnam expert at Singapore's ISEAS Yusof Ishak Institute.
"They might be irritated, but gradualism is the key word here...Vietnam will only embrace the U.S. at a pace that doesn't cause an over-reaction from China."
Zhang Baohui, a mainland security expert at Hong Kong Lingnan University, said he believed Beijing would not be panicked by the carrier visit, in part due to quiet but successful Vietnamese diplomacy.
"Beijing has a much better understanding of Vietnam's balancing formula now," he said.
The Vinson arrives amid repeated signals from the Trump administration that it is keen to further develop security ties with Vietnam as part of a range of political and military relationships to check the rise of China.
Given historic Vietnamese suspicions of Beijing, Hanoi's Communist Party leadership has forged a range of security relationships to balance its own ties with China.
Moscow, its major patron through the Cold War, remains the key supplier to the modernizing Vietnamese military, and India and Israel are increasingly important suppliers.
President Trump himself touted possible missile and other advanced weapons sales during his November visit to Vietnam, but no major arms deal has yet been completed.
His administration's National Security Strategy, published in December, listed Vietnam as a "co-operative maritime partner," Derek Grossman, a senior defense analyst at the U.S. RAND think-tank, said it was uncertain just how fast and how far Vietnam was prepared to go even as it sought to deter China in the South China Sea.
"It seems the U.S. side is still not sure quite what Vietnam wants, but the focus will likely be on ways to enhance Vietnam's maritime domain awareness and maritime security capabilities," he said.
A recent study of Vietnam's military modernization by Grossman, published by the Seattle-based National Bureau of Asian Research, found that Hanoi would struggle to sustain a large-scale conflict if its deterrence strategy failed.
Despite the acquisition of its first submarines, new Russian jet fighters and missiles, Vietnam faced extensive deployment and integration hurdles.