Mayor Bill de Blasio said on Tuesday that he would earmark additional money for New York City’s third water tunnel to ensure that clean drinking water could be delivered to Brooklyn and Queens within 48 hours of an emergency shutdown of City Water Tunnel No. 2.

Previously, officials said that it would take several months to make even nondrinkable water available, which would have been crippling to the five million residents and the businesses in the area.

The city will spend $21 million to disinfect and test the new section of City Water Tunnel No. 3 to prepare it as a backup water source to Tunnel No. 2 by the end of 2017. Tunnel No. 2 is 80 years old, has been in continuous use and has never been shut for inspection. The mayor said the investment would provide “critical redundancy in our system.”

Most of the infrastructure for Tunnel No. 3 is in place, except for two shafts that will connect parts of the tunnel in Queens to the current distribution system and future parts of the system. But the tunnel can deliver water without them and already carries water to parts of the Bronx, Manhattan and Queens.