American flags fly fore and aft on the US missile cruiser Shiloh as it docks at a pier across a narrow waterway from decrepit, decaying buildings of an abandoned US naval base at Subic Bay. The dock was once a bulwark of American power in the South China Sea after US forces seized the base from the Spanish in 1899.

At the end of a long walkway from the pier to shore, eager shopkeepers again sell souvenirs and taxi drivers lie in wait for sailors primed for a night of carousing in the bars of Olongapo, the base town in the Philippines. Now, nearly a quarter of a century after the US Navy had to give up its Subic Bay base and the Clark Air Base across the Zambales mountains to the east, Americans are once again ready to defend the Philippines, and the region.

The Philippines Senate, which had voted in 1991 against renewing the lease on US bases, has dropped its objection to the American return to waters threatened by China’s new insistence on its right to rule almost all the South China Sea – including the Spratly Islands claimed by the Philippines, Vietnam, Malaysia and Brunei.

The increasingly acrimonious relations between Beijing and Washington over the vast area of ocean indicate a rising role for the US – in defence of not only the Philippines’ stake in the waters but also of Vietnam, where 40 years ago the US was ousted in a war for which Subic Bay provided strategic support. On Monday, fresh from proclaiming the right of US ships and planes to move unmolested in waters and airspace claimed by China, the US Defence Secretary Ashton Carter was in Hanoi, listening to a Vietnamese band play “The Star Spangled Banner” and declaring: “We’re both committed to deepening our defence relationship.”

China's territorial disputes Show all 5 1 /5 China's territorial disputes China's territorial disputes South China Sea A satellite image of what is claimed to be an under-construction airstrip at Fiery Cross Reef in the Spratly Islands in the disputed South China Sea China's territorial disputes South China Sea Chinese dredging vessels are purportedly seen in the waters around Mischief Reef China's territorial disputes South China Sea A Chinese Guided Missile Frigate Hengshui docked at a port in Yalong Bay in Sanya, south China's Hainan Province. China's military compared its controversial island reclamation project in the South China Sea to ordinary construction going on in other parts of the country, such as the building of roads and apartments China's territorial disputes South China Sea The alleged on-going land reclamation of China at Subi reef is seen from Pagasa island (Thitu Island) in the Spratlys group of islands in the South China Sea, west of Palawan, Philippines China's territorial disputes South China Sea U.S. military forces aboard Amphibious Assault Vehicles (AAV) manuevre on South China Sea near the shore of San Antonio, Zambales during the annual "Balikatan" (shoulder-to-shoulder) war games with Filipino soldiers in northern Philippines. The U.S. Marine Corps is bringing together foreign commanders from amphibious forces deployed mostly in the Asia-Pacific for a conference aimed at taking initial steps to integrate their operations, with China excluded from the event, according to officials and planning documents

That rhetorical flourish came as a rebuff to China’s second-highest military officer, Admiral Sun Jiunguo, deputy chief of the People’s Liberation Army’s general staff. The previous day, he told regional defence ministers in Singapore that a controversial drive to reclaim land from the shallow waters around Chinese-held islands in the Spratlys was “justified, legitimate and reasonable” and “well within the scope of China’s sovereignty”.

The US and other nations say that China aims to build airstrips and station aircraft on the islands, vastly increasing Beijing’s military reach.

Mr Carter had told the same gathering that “the pace and scope of land reclamation in the South China Sea” sharply raised “the risk of miscalculation or conflict” between China and others who also claim the same islands, reefs and atolls. China, he said, had to bring its project to “an immediate and lasting halt”. He did not say it, but those others include the US, whose planes have been challenged by Chinese aircraft when flying in contested airspace.

Although open warfare does not seem imminent, the prospect of the US returning in force to Subic Bay, once America’s largest overseas naval base, has increased tensions. The Shiloh, one of the most advanced US cruisers, armed with guided missiles and cannon, is expected to ply the South China Sea after taking on fuel and supplies. Other vessels, including at least one destroyer, are likely to join it in a mini-flotilla, posing an immediate challenge as China builds airstrips and other facilities on 2,000 acres of land reclaimed in the past 18 months.

In Subic Bay, people wonder if the arrival of the Shiloh portends a greater US presence. Hopes are high among local people, to whom US sailors typically provide a bonanza of riches despite the anti-US objections of politicians. “Business is not too good,” said a shopkeeper who sold electronic gear to the US military. “We need them.”

The Americans, though, not only have to live down memories of a raucous past but more recent episodes in which US servicemen have been accused of rape and murder. A US Marine is now on trial for allegedly asphyxiating a transgender Filipina.

Last weekend, US service personnel were permitted to visit the town for the first time since that case, a media sensation, went to trial in March. The US embassy urged the crew to “experience Filipino culture” in keeping with “strong historic, community and military connections”. Crew members passed banners boasting that Olongapo was home to “the world’s most beautiful women”. Their manner, at least before sunset, was polite.

Their arrival delighted Olongapo’s mayor Rolen Paulino, who said their absence had made his town and country poorer. Some locals were more guarded. “They are good and bad,” said a policeman. “We are happy to have them, but sometimes they get drunk. Then we have trouble.”

The arrangement under which the Shiloh is docked is controversial, with left-wingers seeing it as a first step to renewing the bases agreement. But protests have receded as President Benigno Aquino III has hit out at Chinese encroachment. Former naval offices near the dock are in disrepair, but there is talk of rebuilding them as a possible successor to the base. US officials talked only of strengthening “people-to-people ties through community outreach”. But as China flexes its muscles, the enclave once famed among US sailors, Marines and soldiers on leave from Vietnam as a wild base town may be about to regain its key strategic importance.

Disputed territory: who claims what

* Beijing says its right to the area goes back centuries to when the Paracel and Spratly island chains were regarded as integral parts of the Chinese nation.

* Vietnam says China never claimed sovereignty before the 1940s. It says it has actively ruled the islands since the 17th century.

* The Philippines invokes its proximity to the Spratly Islands in its claim.