US President Donald Trump has lashed out at the mayor of San Juan and other officials in storm-ravaged Puerto Rico, contemptuous of their claims of a slow American response to the natural disaster that has threatened the island’s future.

“They want everything to be done for them when it should be a community effort,” Mr Trump said in a series of tweets a day after the capital city’s leader appealed for help “to save us from dying”.

“Such poor leadership ability by the Mayor of San Juan, and others in Puerto Rico, who are not able to get their workers to help,” he said.

The tweets were a biting response to San Juan Mayor Carmen Yulin Cruz, who had accused the Trump administration of “killing us with the inefficiency” after Hurricane Maria. She implored the president, who is set to visit the US territory on Tuesday, to “make sure somebody is in charge that is up to the task of saving lives”.

Mr Trump has pledged to spare no effort to help Puerto Rico recover from Maria’s ruinous aftermath, and tweeted that military personnel and first responders had done “an amazing job” despite having “no electric, roads, phones etc”.

Puerto Rico, he said, “was totally destroyed” and “10,000 Federal workers now on the island are doing a fantastic job”.

Mr Trump’s acting homeland security secretary, Elaine Duke, surveyed the Puerto Rican landscape by helicopter during a visit on Friday. She also drove past still-flooded streets, twisted billboards and roofs with gaping holes, and offered encouragement to some of the emergency personnel the US government has on the ground.

Ms Duke also tried to move on from the remarks she made on Thursday in which she called the federal relief effort a “good-news story”. On that front, she ran into winds as fierce as Maria.

“We are dying, and you are killing us with the inefficiency,” Ms Cruz said at a news conference. “I am begging, begging anyone that can hear us, to save us from dying.”

Mr Trump, from his golf club in New Jersey, took to Twitter to accuse her of partisan politics.

“The Mayor of San Juan, who was very complimentary only a few days ago, has now been told by the Democrats that you must be nasty to Trump,” the president charged, without substantiation.

Thousands more Puerto Ricans have received water and rationed food as an aid bottleneck has begun to ease. By now, telecommunications have been restored for about 30% of the island, nearly half of the supermarkets have reopened at least for reduced hours and about 60% of petrol stations are pumping. But many remain desperate for necessities, most urgently water, long after the September 20 hurricane.

Mr Trump said on Friday that Puerto Rico is “totally unable” to handle the catastrophe on its own.

“They are working so hard, but there’s nothing left,” he said. “It’s been wiped out.”

He said the government is “fully engaged in the disaster and the response and recovery effort”.

He added that he was not aware of Ms Duke’s “good-news” remark.

“I haven’t heard what she said,” he told reporters. “I can tell you this: We have done an incredible job considering there’s absolutely nothing to work with.”

Yet even in voicing solidarity and sympathy with Puerto Rico, he again drew attention to the island’s debt burden and infrastructure woes, leaving doubt about how far Washington will go to make the US territory whole.

“Ultimately the government of Puerto Rico will have to work with us to determine how this massive rebuilding effort – it will end up being one of the biggest ever – will be funded and organised, and what we will do with the tremendous amount of existing debt already on the island,” he said. “We will not rest, however, until the people of Puerto Rico are safe.”

During this season’s trio of monster hurricanes – Harvey, Irma and Maria – Mr Trump and his administration have drifted into the perilous territory of premature self-congratulation in the face of unfolding catastrophe, seemingly unmindful of the “Brownie moment” that scarred George W Bush’s presidency.

Mr Bush famously told his emergency management director, Michael Brown, “Brownie, you’re doing a heck of a job” during what proved to be a tragically inept federal response to deadly Hurricane Katrina in 2005.

Mr Trump has repeatedly boasted about the positive reviews he said his administration is getting from Puerto Rico and the US Virgin Islands for its relief effort, even as people in remote towns struggle to find food, water and other basics.

Then Ms Duke said before leaving Washington that the federal relief effort was a “good-news story” because of “our ability to reach people and the limited number of deaths”.

“Let me clarify,” she said on Friday upon arrival in San Juan. She said she meant “it was good news that people of Puerto Rico and many public servants of the United States are working together”.

Ms Cruz responded: “This is a people-are-dying story.”