The Buffalo Sewer Authority will spend $380 million over the next 20 years to reduce the amount of untreated sewage and stormwater runoff flowing into the Niagara River, the Environmental Protection Agency announced Monday.

The work will involve sewage plant upgrades and the installation of rain gardens, pervious pavements, rain barrels and other techniques designed to absorb stormwater and prevent it from overwhelming the sewer system. In some areas, vacant buildings will be demolished to increase green space.