HANOI • Vietnam could hardly have asked for more: a United States warship challenging Chinese claims in the South China Sea, a meeting at the White House and six new coastal patrol boats.
All are signs of a US commitment which Vietnam had feared was waning under President Donald Trump just as the South-east Asian country has emerged as the most forceful opponent of China's claim to one of the world's most important seaways.
But uncertain over how enduring US support will be and wary of relying on any ally, Vietnam is just as carefully cultivating ties with ancient foe China.
"Vietnam doesn't want an imbalance of power in the region that could lead to war," said Mr Tran Cong Truc, a former head of the National Boundary Commission who spent decades defending Vietnam's maritime claims.
The meeting with Mr Trump next Wednesday is a coup for Prime Minister Nguyen Xuan Phuc, who will be the first South-east Asian leader to visit the White House under the new administration.
It reflected calls, letters, diplomatic contacts and lower-level visits that started long before Mr Trump took office in Washington, where Vietnam retains a lobbyist at US$30,000 (S$41,509) a month.
Just as important symbolically for Vietnam this week was having a US warship sail close to an artificial island being built by China in the South China Sea, where Beijing's extensive claims are disputed by Vietnam and four other claimants.
Vietnamese officials and foreign envoys familiar with Hanoi's position said it had been lobbying hard for what former enemy the US calls a "freedom of navigation" mission.
Further underlining US support, Washington delivered six coastal patrol vessels to Vietnam this week. "Vietnam's future prosperity depends upon a stable and peaceful maritime environment," US Ambassador Ted Osius said.
Such words help to ease concerns in Vietnam at being a lonely voice in challenging Beijing in the South China Sea, particularly since Philippine President Rodrigo Duterte has grown closer to China.
Military ties between the US and Vietnam were forged under the Obama administration, but even more important was the strategic Trans-Pacific Partnership trade pact.
Vietnam was disappointed when Mr Trump ditched that deal and focused trade policy on reducing deficits - Vietnam's US$32 billion surplus with the United States was the sixth biggest last year.
Vietnamese nerves were jangled further by Mr Trump's recent cosiness with Chinese President Xi Jinping in trying to tackle North Korea's nuclear programme.
"The total fixation on North Korea had Vietnam quite worried that the South China Sea would be left wide open," said Professor Carl Thayer, a Vietnam expert at Australia's University of New South Wales.
In the face of the uncertainty since Mr Trump took office, Hanoi has been paying as much attention to Beijing as to Washington.
President Tran Dai Quang combined a state visit with his attendance at China's Belt and Road summit. Communist Party chief Nguyen Phu Trong, arguably the most powerful man in Vietnam, was in Beijing days before Mr Trump's inauguration.
After both those visits, the countries emphasised their readiness to keep the peace in the South China Sea, through which some US$5 trillion in trade flows each year.
"'Simultaneously cooperate and fight' is a very practical policy," said Mr Truc. "Vietnam never kneels or surrenders before China's open violation of its legitimate rights, but it does not give China any excuse to use its power to create conflict."