The Amador peninsula separates the concrete and glass skyline of Panama City from the soaring iron arch of the Bridge of the Americas – under which 40 cargo ships pass each day en route to or from the Panama Canal.

This strategic outcrop is home to a handful of derelict buildings once used to house US military personnel. But it has become a new flashpoint in the global rivalry between Beijing and Washington, as the US struggles to develop a coherent strategy to deal with China’s rising influence in Latin America.

China’s plans to build a new embassy on the islands were derailed after US officials pressured the government of Panama’s president, Juan Carlos Varela, to withdraw its offer of a four-hectare plot, according to senior Panamanian and diplomatic sources.

“Of course there was pushback from the US: they weren’t going to allow a huge Chinese flag next to the entrance to the canal,” a diplomatic source told the Guardian. “But local pressure was also important. Handing over that land to the Chinese would have been a hugely unpopular move by the Varela government.”

Panama’s government has insisted that the decision was based on security and environmental concerns.

But a previous plan to build a new Chinese embassy in the traditional diplomatic district of Panama City was also blocked by objections from Washington, and Beijing has now established a temporary mission in an office block.

The incident may prove to be a pyrrhic victory for Washington, however. This weekend, the Chinese premier, Xi Jinping, arrives in Panama for a visit aimed at cementing ties with the Central American nation.

It will be the first such visit by a senior Chinese figure since Panama cut diplomatic ties with Taiwan to open formal relations with Beijing in June 2017.

Since then, the two countries have signed 28 diplomatic and investment agreements, a $500m renminbi-denominated “Panda” bond is expected before the end of the year and Chinese contractors have won major contracts for a port, convention centre and a new bridge over the canal.

The growth of Chinese investment and influence in the country has been the source of growing unease in Washington.

President Juan Carlos Varela, left, and the US secretary of state, Mike Pompeo, talk at the presidential palace in Panama City. Photograph: Brendan Smialowski/AFP/Getty Images

In July, the US secretary of state, Mike Pompeo, ended a visit to Panama with the warning that “when China comes calling, it’s not always to the good of your citizens”. He added that state-run Chinese firms often operated with political, rather than market-driven, motives.

Xi’s visit comes amid an escalating trade war between China and the US, which has highlighted Panama’s strategic importance as a pinch-point of world commerce.

Two-thirds of ships to or from the US pass through the Panama Canal – which was an unincorporated territory of the US between 1903 and 1979 and was home to dozens of American military installations.

“Recent rhetoric from Washington suggests the US has not accepted that the canal has shifted from being a military asset to a commercial one,” said Eddie Tapiero, a competitive intelligence specialist for the Panama Canal Authority and author of a new book on China-Panama relations. “The US has a decision to make: does it accept free trade in the Americas or does it revert to a cold war approach? The latter would be disastrous.”

Negotiations for a free trade agreement between China and Panama are at an advanced stage; Panamanian officials say the country can benefit from its growing role as a regional logistics hub, build its exports to China and protect local farmers.

“We will become the gateway for Chinese goods into Latin America,” the trade minister, Augusto Arosemena, told the Guardian. “I think Panama will be an example of how smaller countries can negotiate with China.”

Meanwhile, the US has been caught flatfooted: diplomats were unaware of Varela’s decision to establish ties with Beijing until hours before its announcement and the state department has yet to name a replacement for John Feeley, who stood down as ambassador in March saying he was “honor bound” to resign rather than serve under Donald Trump.

Wei Qiang, the Chinese ambassador to Panama, has dismissed the “apprehensive, fearful and jealous speculations” over his country’s intentions. “China’s world vision is one of dialogue and accommodation rather than confrontation, we have no option but to let the facts speak for themselves,” he said at a recent book launch.

But in recent years, Beijing has shown growing interest in strategic infrastructure projects in the region: Chinese companies are involved in a project to build a rival interoceanic canal through Nicaragua and investigated the option of a “dry canal” railroad linking Colombia’s Atlantic and Pacific coasts.

Some Panamanians are also wary of Bejing’s intentions, said Euclides Tapia, a professor of international relations at the University of Panama. “The Chinese are here for the long term – and they’ve come for the canal,” he said.