JEFFERSON CITY, Mo. — States will soon be flooded with federal money to address a pent-up need to repair, improve or remove thousands of aging dams across the U.S., including some that could inundate towns or neighborhoods if they fail.

The roughly $3 billion for dam-related projects pales in comparison to the tens of billions of dollars going to roads, rails and high-speed internet in the $1 trillion infrastructure plan signed Nov. 15 by President Joe Biden.

But it’s a lot more than dam projects had been getting.

The money could give “a good kick-start to some of these upgrades that need to be done to make the dams as safe as possible,” said David Griffin, manager of Georgia’s Safe Dams Program and president-elect of the Association of State Dam Safety Officials.

The U.S. has more than 90,000 dams, averaging over 50 years old. An Associated Press analysis in 2019 identified nearly 1,700 dams in 44 states and Puerto Rico deemed poor or unsatisfactory and categorized as high-hazard — meaning their failure likely would result in a deadly flood. The actual number almost certainly is higher, because some states declined to provide complete data for their dams.

Though many large dams are maintained by federal or state agencies, most of the nation’s dams are privately owned. That makes fixing them a challenge because regulators have little leverage over dam owners who don’t have the money to make repairs or simply neglect the needed fixes.

Over the past decade, the Federal Emergency Management Agency provided more than $400 million for projects involving dams, mostly to repair damage from natural disasters. But until a few years ago, there was no national program focused solely on improving the thousands of dams overseen by state and local entities.

FEMA’s Rehabilitation of High Hazard Potential Dams Grant Program has divvied up $31.6 million among 36 participating states from 2019-2021. That amount, appropriated by Congress, was barely one-fifth of what had been authorized under a 2016 federal law.

The infrastructure bill pumps $585 million into the program for hazardous dams, including $75 million for their removal. Because of administrative requirements, FEMA said the new money likely won’t start flowing to states before the 2023 fiscal year, which begins Oct. 1, 2022.

Repairing and modernizing all 14,343 high-hazard dams not owned by the federal government could cost more than $20 billion, according to an estimate by the dam safety association.

“The program is not really intended to fix all of them, but this will definitely help to fix some of the worst of those,” said Mark Ogden, a former Ohio dam safety official who is now a technical specialist at the association.

The legislation also includes $148 million for FEMA to distribute to state dam safety offices — a significant increase over the $6 million to $7 million annually that has been divided among states. Every state except Alabama has a dam safety program, but many are underfunded and understaffed, creating a backlog of work.

The bill also includes about $750 million that could fund improvements at hydroelectric dams or retrofit existing dams to start producing energy. That includes a new grant program capped at $5 million a year per facility.

The funding in the infrastructure bill “is just a down payment,” said LeRoy Coleman, spokesman for the National Hydropower Association. “We need transformational change for more clean energy and for healthier rivers.”