NEAR the point where Vietnam bulges deepest into the South China Sea lies Cam Ranh Bay, perhaps the finest natural deepwater harbour in South-East Asia. France based a fleet there in colonial times. Russian ships made use of it in the Russo-Japanese war, Japanese ones during the second world war and American ones during the Vietnam war.

After the American withdrawal and communist triumph, the government of the newly reunited Vietnam leased the naval base to the Soviet Union. Russia gave up the facility in 2002. Today it is Russian tourists who flock to Cam Ranh International Airport, with its American-built airstrip, on their way to the beaches of nearby Nha Trang.

These days Vietnam ostensibly follows a policy of “Three Nos”: no military alliances, no foreign bases and no joining with another country to fight a third. Nonetheless, adjacent to the Vietnamese naval base at Cam Ranh is a facility that receives foreign military vessels. In theory it is a purely commercial venture, open to the ships of any country willing to pay for the maintenance and refuelling it provides. But it also serves a strategic purpose: sending a defiant message to a resurgent and expansionist China by allowing Vietnam to strengthen military ties with an increasingly diverse group of countries.

Anti-Chinese sentiment runs deep among ordinary Vietnamese. Vietnam fought wars against both America and China in the 1970s. But these days Americans, by and large, are received with affection, whereas many Vietnamese remain convinced that China still has territorial designs on their country.

In 2014 China sent an oil rig to a disputed part of the South China Sea, sparking anti-Chinese riots in Vietnam. Since then both sides have been careful not to stoke tensions. China has called off the drilling; Vietnam has made mollifying noises about solving disputes bilaterally, as China prefers. But for Vietnam, the underlying problem is unchanged: how does a small, poor country defend itself against a bigger, richer one?

The Philippines, under Rodrigo Duterte, has pioneered one approach: apparent capitulation. In exchange for massive investment in infrastructure, Mr Duterte has decided not to press China over their territorial dispute. Vietnam, using Cam Ranh Bay, is trying something else: diversification. Since the foreign-vessel facility opened a year ago, it has received 19 ships from 10 countries. China and America tie for the most visits, at three each. But every other visit save one has come from countries that have shown some form of opposition to China’s expansive maritime claims, including France and Japan. Vietnam appears to be reminding China of just how many friends and suitors it has—and just how well it can look after their warships.