Lawmakers on Thursday blasted President Donald Trump's plan to siphon $400 million from military construction projects in Puerto Rico to help pay for his long-promised wall along the southern border.

The "repurposing of these funds will make Puerto Ricans less safe by reducing U.S. military readiness and diverting resources from Puerto Rico’s National Guard," Rep. Nydia Velázquez, D-NY, said in a statement.

The $402 million is part of $3.6 billion in military construction money that's being diverted by the Department of Defense to pay for 175 miles of fencing along the U.S.-Mexico border. Half the money is being taken from domestic projects and the other half from international projects.

Puerto Rico — a U.S. territory that's been repeatedly criticized by the president — was targeted for the biggest diversion of funds domestically, despite its struggle to rebuild after 2017's Hurricane Maria and a corruption scandal that forced its governor from office.

Among the projects affected are power substation and a National Guard readiness center.

"Not only will the reprogramming of these funds make Puerto Rico less prepared in the event of disasters, but it would likely harm the local economy by depriving on-island contractors of job-creating opportunities," Velázquez said, calling the move "shameful." "The President intends to steal money from an already impoverished Island to finance his coldhearted persecution of immigrants," she said.

Rep. Jenniffer González-Colon, the island's non-voting member in Congress and a Republican, said "Puerto Rico is an insular jurisdiction that primarily relies on assets maintained on the ground. As we continue evaluating lessons learned by the 2017 hurricane season and the consequences it had on my constituents, we need to allow military units on the island to have the resources they need as they are the first line of defense in the aftermath of any natural or man made disaster.”

Rep. Darren Soto, D-Fla., told NBC News in an e-mailed statement that Trump's plans to put off military construction in Puerto Rico and Florida show that “he is willing to put national security in jeopardy, hurt our troops and derail disaster recovery, to fund his ineffective, medieval border wall."

Over 1 million Puerto Ricans live in Florida.

Trump, whose response to the 2017 hurricane received widespread criticism, has complained since that the territory's politicians weren't grateful enough for the aid they'd received and has sought to cut the amount of aid it will get in the future. He has also repeatedly vastly overstated the amount of disaster aid that has gone to the island, claiming it had received $92 billion in aid when it'd actually gotten $14 billion, and reportedly privately joked about trading the island to Denmark in return for Greenland.

Last week, Trump complained on Twitter that then-tropical storm Dorian appeared to be headed to Puerto Rico, "as usual." He went on to call it "one of the most corrupt places on earth. Their political system is broken and their politicians are either Incompetent or Corrupt. Congress approved Billions of Dollars last time, more than anyplace else has ever gotten, and it is sent to Crooked Pols. No good!"

He added that, "FEMA and all others are ready, and will do a great job. When they do, let them know it, and give them a big Thank You - Not like last time."

In total, the Pentagon is redirecting money for military projects in 23 states, 3 U.S. territories and 20 foreign countries towards wall construction.

Democratic presidential candidate Beto O'Rourke noted on Twitter that some of the money being diverted in Europe could impact allies' abilities to protect themselves from Russia.

"Trump is defunding hurricane recovery in Puerto Rico, and laying off of Russia in Europe, to fund his racist border wall," the former Texas congressman tweeted.

The border wall has been one of Trump's signature promises as both a candidate and later as president. He repeatedly promised that American taxpayers wouldn't have to foot the bill.

"Mexico will pay for the wall - 100%!" he tweeted three years ago this week.