A coalition of 20 state attorneys general have filed a lawsuit against the Federal Emergency Management Agency over its plan to shut down a major disaster mitigation program, arguing the move is illegal and puts communities at risk amid growing climate threats.

The suit, filed in the U.S. District Court for Massachusetts, argues that the Trump administration’s plan to shutter FEMA’s Building Resilient Infrastructure and Communities (BRIC) program is illegal and would harm local communities.

“This administration’s decision to slash billions of dollars that protect our communities from floods, wildfires, and other disasters puts millions of New Yorkers at risk,” New York attorney general Letitia James, one of the AG’s involved in the suit, said in a statement.

READ MORE: Homeowners’ insurance claims experience strained: J.D. Power

BRIC is a competitive grant program that funds state and local infrastructure projects designed to reduce the impact of natural disasters. FEMA has awarded roughly $4.5 billion through BRIC to more than 2,000 projects over four years, supporting initiatives to build tornado shelters, floodwalls, and pump stations. The program has been consistently oversubscribed, with the federal government receiving requests for far more money than it has to give out.

Attorneys general argue that canceling the program undermines the federal government’s obligation to help states prepare for increasingly severe weather events. They cite both the constitutional separation of powers and a Congressional mandate directing FEMA to support mitigation.

The complaint called the shutdown “devastating” and argued that cutting the program will leave states and cities vulnerable to natural disasters, including flooding and wildfires, both of which have become more common and severe as the effects of climate change become more pronounced. 

“Projects that have been in development for years, and in which communities have invested millions of dollars for planning, permitting, and environmental review are now threatened,” the lawsuit said. “And in the meantime, Americans across the country face a higher risk of harm from natural disasters.”

The suit outlined a number of programs that it says are in jeopardy now. A county in Oregon lost nearly $14 million in funding to help build an elevated shelter that would have protected local residents in case of a tsunami. In Washington state, plans to build a pair of levees in the west of the state are in limbo after more than $97 million was suddenly pulled.

The costs of increased and more extreme natural disasters have put a strain on insurers in some states, including California, where January wildfires will likely cost more than $45 billion in losses. Wildfires in Los Angeles and major flooding in Texas have wrought havoc on communities. Even homeowners located in areas traditionally less prone to extreme weather events have been buying additional insurance as disaster zones expand

The lawsuit comes as FEMA’s future is in doubt. Soon after taking office, President Donald Trump began to talk about shutting down the agency, and as recently as last month he mused about “phasing out” FEMA after this year’s hurricane season. Recent wildfires in Texas may have spurred a change of heart, though. In recent days, officials such as homeland security secretary Kristi Noem have softened their rhetoric, saying that the agency should be “remade” and “redeployed in a new way” instead.