The San Francisco Municipal Transportation Agency has secured nearly $40 million in federal funding to purchase up to 24 new diesel-hybrid buses, the Office of Mayor Daniel Lurie announced.

The grant from the U.S. Department of Transportation will help modernize Muni’s fleet and improve system reliability as the agency faces a projected budget deficit of $306 million, expected to rise to $434 million by 2030, the mayor’s office said in a statement.

The funding reportedly supports the city’s Heart of the City recovery plan, aimed at strengthening downtown.

SFMTA Director of Transportation Julie Kirschbaum said the investment will reduce breakdowns and support more dependable service for the system’s 500,000 daily riders.

The agency plans to use the grant to replace aging vehicles and continue transitioning its fleet of 575 hybrid buses.