JUST as South-East Asian countries were heaving a sigh of relief that China and the Philippines appeared to be drawing back from confrontation in the South China Sea, new tension has arisen between China and Vietnam in the same stretch of ocean. In recent days the two countries stepped up their sparring over archipelagoes and oil rights nearby, even dropping hints of military resolve to back their rival claims. Few predict imminent conflict, but a revival of old animosities between China and Vietnam could yet open huge rifts within the region.

The easing of weeks-long tensions between China and the Philippines last month appeared to signal that both countries saw too much to lose in continuing their high-profile spat over ownership of the Scarborough Shoal (see map). For all that it enjoys American support, the Philippines knew it would probably be badly bruised in any military showdown. China, despite its fulminations, appeared to worry that a show of force risked damaging its image and causing South-East Asian countries to turn even more to America for security. The Philippines said it withdrew its two government ships from the shoal on June 15th, citing bad weather. Chinese boats reportedly followed suit, though it is not clear how completely. But the calm was brief. On June 21st Vietnam's parliament passed a maritime law that reasserted the country's claims to the Spratly and Paracel Islands. China called this a “serious violation” of its sovereignty. It responded by declaring that a county-level government which supposedly governs the two archipelagoes and much of the rest of the South China Sea from one of the Paracel Islands, had been upgraded to the administrative level of a prefecture. Chinese media described this notional jurisdiction, Sansha, as by far the biggest prefecture in the country (though its population of a few hundred people is heavily outnumbered by gulls and its ill-defined territory is mostly water). Some Chinese internet users speculated excitedly about who might be appointed mayor, but reports on some websites that a 45-year-old hydrologist had got the job were later dismissed as a spoof. Tensions rose further with an announcement late last month by CNOOC, a Chinese state-owned oil company, that it was opening nine blocks in what China calls the South Sea to international bids for oil and gas exploration. These reach to within 37 nautical miles (68km) of Vietnam's coast, according to PetroVietnam, a Vietnamese state-owned oil firm. Carlyle Thayer of the University of New South Wales says CNOOC's move was probably a “political stunt” in response to Vietnam's new law, about which China had long been expressing concerns. Mr Thayer says that, given the disputes, China's offer will get a cool reception from oil firms. Worryingly, however, both countries have been sending stronger signals that they might defend their claims with force. China's defence ministry said on June 28th that it had launched “combat-ready” patrols in the South China Sea. Earlier Vietnam stated that it was conducting regular air patrols over the Spratlys. Some of this may be dressing up of routine activity. But China fought more recently with Vietnam than with any other country. Their last big skirmish, a naval encounter in the Spratlys in 1988, left over 70 Vietnamese dead. Relations have improved greatly since, but mutual wariness persists. Vietnam, then a Soviet ally, has to China's chagrin recently forged military links with America.

Neither side wants this to escalate. Chinese diplomats have been trying to project a more accommodating image since a bout of chest-thumping over the South China Sea in 2009 and 2010 which heightened anxieties in the region and damaged China's efforts to project its rise as peaceful. In mid-July South-East Asian foreign ministers, as well as America's secretary of state, Hillary Clinton, and China's foreign minister, Yang Jiechi, will discuss regional security in the Cambodian capital, Phnom Penh. China does not want the kind of confrontation this time around that it endured at a similar gathering two years ago, when Mrs Clinton asserted that the sea was America's national interest, rallying China's regional rivals over the issue.

Popular nationalism is a wild card. On July 1st hundreds of people joined rare protests in Hanoi and Ho Chi Minh City against China's assertion of claims to the Spratlys and Paracels. Vietnam, like China, is normally intolerant of public demonstrations, but police did little to intervene.

In China Global Times, a newspaper that champions nationalist causes, used an editorial on July 4th to lash out against both Vietnam and the Philippines (which had transgressed again by saying on July 2nd that it might ask America to deploy spy planes in disputed areas). The newspaper said China should respond cautiously, but that both countries deserved punishment. It also warned that if they went to “extremes in their provocations”, this might involve military strikes.

Chinese leaders do not want a burst of nationalist sentiment that might backfire should they fail to satisfy popular demands. But uncertainty abounds as China prepares for big changes in its civilian and military leadership in the autumn. Contenders for power do not want to appear weak. As Global Times growled, “If these island disputes had happened in imperial times, they would have been handled in a much easier way.”