Given the history of hostility between Vietnam and its former enemies China and the US, they make strange bedfellows. Yet Hanoi is now the stage for an increasingly elaborate diplomatic tango. It's a sign of the strategic shifts under way in the region as smaller countries adjust to China's rise.
Despite lingering suspicions, Vietnam has been deepening and broadening relations with its giant neighbour, with whom it shares a 1,400km land border. At the same time, Vietnam is quietly building ties with the United States - something hard to imagine a decade ago - just as Washington appears keen to cement new friendships in Asia to keep a check on China.
'We are all watching how Vietnam handles China as well as building a new strategic friendship with Washington,' said one veteran Association of Southeast Asian Nations envoy in Hanoi. 'It is fascinating stuff ... There is a view among us that if there is one country in this region that is prepared to stand up to China at times, it is Vietnam. It is going to want some new friends on board first.'
No other country in Southeast Asia has a history with China quite like Vietnam's. Close fraternal relations between their revolutionary Communist Party leaderships grew frosty as Hanoi increasingly leaned towards the Soviet bloc.
Tensions escalated into war in late 1978 as Deng Xiaoping ordered troops to invade Vietnam. The aim was to teach the Vietnamese a lesson for invading Cambodia to drive the ultra-Maoist Khmer Rouge from power.
It was a brief but exceptionally bloody campaign. Tens of thousands were killed or wounded in a month of fighting as PLA troops faced minefields and village militias who were highly motivated and battle hardened.
For the Vietnamese, China's incursion was no surprise. Their sense of identity is steeped in ancient campaigns to drive out the Chinese rulers who dominated them for the first millennium. For centuries after, they remained a tributary state.
Formal relations between the two nations were restored in 1991 and the relationship has started to blossom as both sides take a pragmatic approach, keeping ties focused on a peaceful future and
not letting lingering disputes upset the cause of the wider relationship. Both sides are looking to co-operate in new areas.
China is now Vietnam's biggest trading partner - the latest International Monetary Fund figures, for 2006, show a trade deficit for Vietnam of more than US$5 billion, a potential source of friction - and that relationship is set to expand as road and rail links across the border are developed as part of China's growing links with the Mekong region.
Land disputes have been settled and the marking of the entire border is expected to be finalised this year. Talks are also progressing over the demarcation of sea borders in the Tonkin Gulf, which separates the island of Hainan from Vietnam.
However, tensions linger in the South China Sea, which Hanoi calls the Eastern Sea. Both sides claim the potentially oil- and gas-rich waters around the Spratly Islands. Despite a non-binding declaration by Southeast Asian states, including Vietnam, and China in 2002, tensions flared last year as Hanoi and Beijing pressed their claims.
In a study published this week by the Jamestown Foundation in the US, Singapore-based academic Ian Storey noted Vietnamese anger at China's protest last year over Hanoi's move to allow a consortium led by BP to develop two gas fields off its southeast coast - and inside its exclusive economic zone.
Despite Hanoi being sure of its legal rights, BP suspended work until further notice. 'Energy-hungry Vietnam was furious at China's perceived bullying,' wrote Mr Storey, a senior fellow at the Institute of Southeast Asian Studies in Singapore. 'Among the 10 members of Asean, Vietnam's relationship with the PRC is without question the most complicated, multifarious, tense and conflict-prone.'
One veteran western diplomat based in Hanoi described the contradiction in the minds of Vietnamese officials. 'They talk freely with China now, and they talk a lot and at many levels. But the old hatreds and suspicions are still there, very definitely. They are very wary of anything perceived as bullying or being pushed aside.'
Yet for all that, diplomats on both sides talk of a determination not to let their feelings cloud the need for better relations on all fronts.
Saying that both sides recognised the need to look constantly to the future, Vietnamese Foreign Ministry official Luan Thuy Duong said that, overall, Hanoi was happy with the progress of the relationship.
She highlighted intensifying contacts between Communist Party officials as well as between individual ministries in strategic areas such as public security and defence, and between provincial administrations across the border. 'These are very significant in terms of the relationship day to day,' said Ms Duong, deputy director general of the Foreign Ministry's Institute for International Relations.
She also pointed to talks on potential areas for further co-operation, including joint development of nuclear energy, natural disaster relief and scientific exchanges. Vietnam acknowledged China's peaceful rise as the region's most powerful nation and wanted solidly developing relations, she said.
Yet significantly, Ms Duong and other officials insisted the China relationship was not the priority for Vietnam's foreign relations. 'We have a firmly multilateral foreign policy,' she said. 'That means we want many friends, in the region and beyond, and China is part of that.'
In that regard, observers of the Vietnamese scene are closely watching the evolving US-Vietnam embrace. Out of the ashes of the bitter post-Vietnam-war era, when Vietnam struggled under a complete US economic embargo, an intriguing relationship has emerged.
Vietnamese officials are discreet about the relationship, apparently wary of irking China, yet the increasing warmth towards the US is clear. China's increasing role and presence in neighbouring Laos and Cambodia - both strongly allied to Hanoi - was in part driving the embrace, said diplomatic sources. Vietnam is also steadily improving ties with US allies such as Japan and South Korea, both big investors and aid donors.
Assistant Secretary of State Christopher Hill, the lead US State Department envoy to East Asia, spoke extensively about the potential of the US-Vietnamese relationship when he addressed Congress last month. A few years ago, such a briefing would have been dominated by the ongoing effort to recover the remains of missing US servicemen and Washington's concerns over human rights in Vietnam and little else.
Those concerns remain, but are put in the context of a rapidly developing trade and investment relationship as well as growing security ties and co-operation over social programmes and education.
'Vietnam's economic and cultural integration into the world has helped open its society and expand social freedoms,' said Mr Hill. 'Vietnamese citizens today enjoy great freedom to live, work and practise their faiths, and most enjoy significantly improved standards of living.'
Vietnam's entry to the World Trade Organisation early last year confirmed the role of the US as its major export market and the US is rising up the ranks of foreign investors, a chart dominated by South Korea, Singapore and Japan, with Taiwan and Hong Kong also playing key roles.
China is well down the list and plays a role far less prominent than in smaller neighbours such as Myanmar, Laos and Cambodia. Vietnamese officials are privately hoping to see greater levels of mainland investment, however, even if suspicions linger.
In less visible ways, the US presence is expanding. Naval ship visits to southern, central and northern ports have continued after starting in 2003. This year the hospital ship USNS Mercy is expected to visit in the summer. Pentagon officials are also expected to seek to expand ties by offering to help Vietnam with search and rescue training.
Less officially, Washington is also gaining ground with the Harvard-affiliated Fulbright Economics Training Programme in the southern commercial hub of Ho Chi Minh City. Mr Hill described the effort as 'highly successful'. Dozens of mid-ranking Vietnamese officials have completed training, which will soon expand into a full MBA programme.
'This shows just how far the US-Vietnamese relationship has come,' said one source involved in the Fulbright effort. 'That we are involved in directly training their officials is remarkable. Just a few years ago this would have been treated with considerable suspicion, if not outright hostility.'
Other Hanoi-based diplomats describe a lingering suspicion of US motives in some quarters, with the phrase 'peaceful evolution' - code for defeating Communist Party rule through engagement - still bandied about.
'Vietnam is being exceptionally cautious but is clearly open to progress ... and the Vietnamese see an increasing value in a good and broad relationship with the US,' said one well-placed Hanoi diplomatic source.
'At the moment it is important to the party leadership, and a big part of it is managing the relationship with China. It is quite a dance step, but Vietnam is determined to pull it off. How they handle it will have an impact on the rest of the region.'