WASHINGTON — Congress has approved a sprawling bill to improve the nation’s ports, dams and harbors, protect against floods, restore shorelines and support other water-related projects.

If signed by President Donald Trump, America’s Water Infrastructure Act of 2018 would authorize more than $6 billion in spending over 10 years for projects nationwide, including one to stem coastal erosion in Galveston, Texas, and restore wetlands damaged by Hurricane Harvey last year.

The bill also would help improve harbors in Seattle; Savannah, Georgia; and San Juan, Puerto Rico, and extend a federal program to improve drinking water quality in Flint, Michigan, and other cities.

Lawmakers from both parties hailed the measure.

The bill also sets up a new framework for large water projects run by the U.S. Army Corps of Engineers. The changes are intended to increase local input and improve transparency.

The Senate approved the bill, 99-1, on Wednesday. Sen. Mike Lee, R-Utah, cast the lone dissenting vote. The House approved the bill last month on a voice vote.

Lawmakers from both parties hailed the measure, which they said will create jobs and help communities across the country fix irrigation systems, maintain dams and reduce flooding.

“America needs comprehensive water infrastructure legislation that will cut Washington red tape, create jobs and keep communities safe,” said Sen. John Barrasso, R-Wyo., chairman of the Senate Environment and Public Works Committee.

The panel’s top Democrat, Delaware Sen. Tom Carper, said the bill invests in critical infrastructure like dams and ports, expands federal efforts to prevent another water crisis similar to the one in Flint and helps coastal communities prepare for the growing risks of climate change.

Flint’s tap water became contaminated in 2014 after officials switched from the Detroit system to the Flint River to save money, exposing many residents to lead, a potent neurotoxin. Some Flint children later were found with elevated blood lead levels, which can cause developmental delays and other health problems.

State and city officials say Flint’s water is now safe to drink, but many residents remain skeptical. The Environmental Protection Agency says there is no safe level of lead.

The bill includes more than $4 billion for the EPA’s Drinking Water State Revolving Fund, which provides money to states and utilities to improve drinking water infrastructure.

The bill also would speed approval of some hydropower projects under a provision led by Sen. Maria Cantwell, D-Wash. The measure awards credit to dam operators that upgrade infrastructure before applying for relicensing.

“Giving our utilities the flexibility to better plan ahead will keep our energy sources safe and save taxpayers money,” Cantwell said.

Lee, the bill’s lone named opponent, said it spends federal dollars on a series of local projects that should be funded and maintained by state and local governments.

“This bill is not the much-needed reform that national water infrastructure needs. Instead it is simple continuation of the failing status quo,” he said.

READ MORE: Study confirms how lead got into Flint’s water