Federal and state water-quality regulators have cleared the way for the city of San Diego to avoid costly upgrades to an outdated wastewater treatment plant, as long as local officials continue to pursue a $3 billion water recycling program.

The U.S. Environmental Protection Agency and the San Diego Regional Water Quality Control Board approved on Monday the city’s permit application to operate the Point Loma Wastewater Treatment Plant for another five years despite it being the only facility of its kind not to meet federal clean water standards.

The so-called permit waiver is part of a longstanding deal between city officials, regulators and members of the environmental community aimed at freeing up money to pay for a water recycling program, known as Pure Water San Diego.

This is an “important milestone in the protection of both coastal water quality and improvement of local water supply reliability,” Dave Gibson, executive officer of the regional water board, said in a statement.

Independent scientific studies have shown that while discharges into the Pacific Ocean from the wastewater plant do not always meet secondary treatment standards, releases have little to no impact on the surrounding marine environment. The city has been repeatedly granted the EPA waiver since 1995, allowing the local government to forego a roughly $2 billion overhaul of the site.

“This is huge for San Diego because we’ll be able to avoid unnecessary and expensive upgrades at the Point Loma plant and can instead invest those dollars to create an independent, drought-proof water supply for our residents,” Mayor Kevin Faulconer said in a statement. “With this permit renewal, the EPA is showing strong support for our Pure Water recycling program as we chart a path toward water independence.”

In July, Pure Water got another major boost when the federal government announced the city was chosen for a low-interest loan program that is expected to bring in about $492 million to jump start the program.

The Pure Water project is slated to break ground in 2018 and generate a third of San Diego’s drinking water by 2035. The first phase is expected to be completed by 2021, producing 30 million gallons of drinking water per day at a facility to be built across the street from the North City Water Reclamation Plant near Miramar Road.

Up to two more facilities would follow — one at the former Naval Training Center grounds on Harbor Drive and another, if needed, at the South Bay Water Reclamation Plant on Dairy Mart Road. This second phase is expected to add 53 million gallons per day.