President Donald Trump on Thursday disputed the latest official death toll in Puerto Rico attributed to Hurricane Maria.

He said in a tweet on Thursday morning that when he visited the island after the hurricane last year the death count was much lower.

A study commissioned by the Puerto Rican government released in late August found that 2,975 people died because of the storm.

The Trump administration has received harsh criticism for the way it responded to the hurricane.

Trump on Thursday accused Democrats of inflating the number to make him "look as bad as possible."

President Donald Trump on Thursday blamed Democrats for the "really large number" of deaths reported in Puerto Rico following Hurricane Maria last year, challenging the official death toll even though a government-funded study found similar numbers.

Trump said in a tweet on Thursday morning that when he visited the island following the hurricane last year, the death count was much lower.

"3000 people did not die in the two hurricanes that hit Puerto Rico," he said. "When I left the Island, AFTER the storm had hit, they had anywhere from 6 to 18 deaths. As time went by it did not go up by much. Then, a long time later, they started to report really large numbers, like 3000."

He added in a second tweet: "This was done by the Democrats in order to make me look as bad as possible when I was successfully raising Billions of Dollars to help rebuild Puerto Rico. If a person died for any reason, like old age, just add them onto the list. Bad politics. I love Puerto Rico!"

A woman trying to leave her house on September 21, 2017, in Salinas, Puerto Rico, after the area was hit by Hurricane Maria. REUTERS/Carlos Garcia Rawlins

Trump visited the island and evaluated relief efforts after Hurricane Maria hit the US territory. His visit came after local officials in Puerto Rico, including Mayor Carmin Yulín Cruz of San Juan, argued he was not doing enough to help.

A study commissioned by the Puerto Rico government released in late August found that 2,975 people died because of the storm, making Hurricane Maria the second-deadliest storm in US history.

Trump was correct that the death toll provided by the Puerto Rican government was initially much lower, as the government originally said 64 people were killed as a result of the hurricane, but the lower number was met with skepticism early on as reports of many more deaths poured in during the months after the hurricane. That helped prompt the government-funded study.

Puerto Rico's government raised the official death toll to 2,975 on August 28.

A separate study published earlier in August found that 1,139 people died in hurricane-related deaths, an estimate the study's authors called "conservative."

President Donald Trump faced scrutiny last year for the way he tossed rolls of paper towels like basketballs to victims of Hurricane Maria when he visited in Puerto Rico. Evan Vucci/AP

In a tweet responding to Trump's claims on Thursday, Yulín Cruz hit back.

"This is what denial following neglect looks like: Mr Pres in the real world people died on your watch," she said. "YOUR LACK OF RESPECT IS APPALLING!"

Trump faced criticism earlier this week after boasting about his administration's efforts in Puerto Rico, saying they were "incredibly successful."

"It was one of the best jobs that's ever been done with respect to what this is all about," he said.

Trump's former homeland security adviser, Thomas Bossert, said the president was lacking "empathy" when he called the Puerto Rico relief effort a success.

"I wish he'd paused and expressed that, instead of just focusing on the response success," he told The New York Times on Wednesday.

He added: "The people that died — thousands of people — it's terrible, but it's always difficult to talk about the causality of that death."

His comments came as Hurricane Florence approached the US mainland. The storm was downgraded from a Category 4 to Category 2 on Thursday, but forecasters were still predicting devastating flooding across the Carolinas and Virginia from storm surge and heavy rains.