[What you need to know to start your day: Get New York Today in your inbox.]

A federal judge rejected a sweeping settlement on Wednesday that would have appointed a monitor to oversee the troubled New York City Housing Authority and required the city to pump at least $1.2 billion into repairs.

The judge, William H. Pauley III, also strongly suggested that the federal government should take over the authority instead.

In a scathing opinion, Judge Pauley deplored the “breathtaking scope” of the squalid living conditions in the city’s public housing complexes. He rebuked the city for its mismanagement of the agency, and said the federal government had abdicated its legal responsibility to overhaul the nation’s largest stock of public housing that is home to about 400,000 vulnerable New Yorkers.

The unexpected ruling threw the future of the Housing Authority into doubt and unraveled a deal that Mayor Bill de Blasio had staked his reputation on as a champion of public housing tenants.