When Vietnam's prime minister sat down with President Donald Trump at the White House last week, it reflected a concerted Vietnamese diplomatic effort unmatched by most Asian peers.
It also underlined the strategic importance the one-time enemy has secured under Trump in the face of China's increasing regional weight and despite a growing surplus that frustrates U.S. trade hawks.
Among Asian leaders, Prime Minister Nguyen Xuan Phuc's reception followed only those for his Japanese and Chinese counterparts.
Fearful it would lose security and business gains made under the Obama administration, Vietnam started to prepare as soon as Trump was elected.
"We were already calculating options," said Tran Viet Thai, vice head of Vietnam's Institute for Foreign Policy and Strategic Studies, Diplomatic Academy of Vietnam.
Vietnam got a call set up between Phuc and Trump more than a month before he took office.
Helping to spearhead contacts was Vietnam's ambassador in Washington, Pham Quang Vinh, a veteran of successful efforts under the Obama administration to lift an embargo on arms sales.
Pham was also instrumental in the Trans-Pacific Partnership (TPP) trade pact, which Trump ditched, to Vietnam's consternation.
Unlike most Southeast Asian countries, Vietnam retains a Washington lobbying firm — the Podesta Group — which it pays $30,000 a month, according to Justice Department documents.
Both the foreign minister and deputy foreign minister made trips to Washington. Also pressed into service were friends in congress, academics and both U.S. and Vietnamese businesses, according to diplomats and researchers.
Vietnam's message was taken to the National Security Council, specifically to Matt Pottinger, senior director for East Asia, and to Vice President Mike Pence's office as well as Defense and State Departments.
Having a career U.S. ambassador in Hanoi helped. Vietnamese-speaking Ted Osius was not among political appointees swept out by Trump.
Vietnam sought multiple routes to Trump.
"They really 'flooded the zone' and comprehensively improved the relationship," said Carl Thayer, of Australia’s Defence Force Academy. "At this point it does seem to be a success as a piece of pro-active diplomacy from Hanoi."
There were broad smiles at the White House, where Trump appeared more at ease with Phuc, than Western leaders who bridle at his "America First" policies.
China is always near the top of Vietnam's concerns, although it tries to avoid alienating its neighbor.
The joint statement with Trump was just as supportive for Vietnam as one last year, particularly on the South China Sea, where Vietnam is the most vocal opponent of Chinese claims. The sea is officially known in Vietnam as the East Sea
In fact, there was more: a possible U.S. carrier visit, acquisition of U.S. defense equipment and both naval and intelligence cooperation.
Trump is due in Vietnam in November for the meeting of countries in the Asia Pacific Economic Cooperation group.
The problem for Trump is the trade deficit, the United States' sixth biggest last year at $32 billion.
In the first four months of 2017, Vietnam's U.S. exports grew over $400 million more than U.S. imports did.
Some $8 billion in new deals with U.S. firms hailed by Trump during Phuc's visit were less than they seemed: at least $5 billion related to deals made public last year.
Trump's decision to abandon the TPP trade pact in the name of protecting U.S. jobs didn't only harm Vietnam, which would have seen tariffs disappear. It would have forced Vietnam to improve access to a market of over 90 million people - more than Germany but with economic growth four times as fast.
"Vietnam's commitments under TPP would have opened many new markets for American exporters," James Fatheree, Asia executive director of the U.S. Chamber of Commerce, told Reuters.
Phuc told Trump he would keep to commitments on improving intellectual property rights and labor laws. But without TPP's sweeping provisions, scores of points will need discussion.
In Tokyo on Monday, Phuc said his government would negotiate a bilateral agreement with the U.S., calling Asian countries not to let the fear of protectionism deter them from strengthening economic ties, the Nikkei Asian Review reported.
U.S. pig farmers want Vietnam to open up Asia's second biggest pork market; electronic payment providers are concerned at being forced to channel payments through a state monopoly; restrictions hamper the growth of online advertising; government procurement is opaque.
Phuc and Trump's statement gave an indication of the complexity with mentions of advertising and financial services, information-security products, white offal, distiller’s dried grains, catfish, shrimp, and mangoes.
"While the U.S. will try to address the imbalance, the relationship is not strictly about trade," said Vietnam expert Jonathan London of Leiden University. "It’s about the future economic and security order in the Asian region."