This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

NEW YORK — New York City and U.S. housing officials announced a deal Thursday that will keep the city’s massive public housing system out of federal receivership, but require the city to spend $2.2 billion over the next few years fixing chronic problems with lousy living conditions, lead paint and lack of heat.

Ben Carson, Secretary of Housing and Urban Development (HUD), and New York City Mayor Bill de Blasio shake hands on Jan. 31, 2019 after signing a ceremonial agreement between the federal government and the City of New York intended to correct mismanagement of the New York City Housing Authority. (Drew Angerer/Getty Images)

The settlement, announced by U.S. Housing Secretary Ben Carson and Mayor Bill de Blasio, resolves a lawsuit in which federal authorities filed on behalf of the system’s 400,000 tenants.

It would put the New York City Housing Authority under the eye of a federal monitor, but stop short of a solution suggested by a federal judge last fall, which would be to take the system out of the city’s hands and place it under federal control.

Carson called the agreement a “positive outcome” for the nation’s largest public housing system. De Blasio, a Democrat, called it “a partnership to get things done for the residents.”

Carson, the top housing official in Republican President Donald Trump’s administration, said that he and the Democratic mayor “were able to put aside any political differences and think about, what would provide the right kind of environment for the people here?”

De Blasio, who joined Carson at a formal announcement in lower Manhattan, said Carson “has shown me a level of focus and concern that I deeply appreciate. And most importantly, the 400,000 New Yorkers who live in public housing I know will appreciate because we were able to get to a cooperative and constructive outcome.”

Tenants in the system have complained for decades about rodents, mold and heat and hot water outages. Authority chairwoman Shola Olatoye resigned last year after an investigation revealed years of falsified reports about lead paint inspections.

An earlier $2 billion deal between the city and federal government was rejected by U.S. District Judge William Pauley in November.

Pauley, after hearing testimony from tenants, said that earlier settlement wouldn’t do enough to improve conditions. He suggested the federal government should take over the authority and gave the city a mid-December deadline to file papers outlining a repair plan to avert a federal takeover. The deadline was later extended to Jan. 31.

Under the agreement announced Thursday, the lawsuit will be withdrawn 14 days after the appointment of a federal monitor. The city will pay for the monitor, who will submit regular reports to the federal Department of Housing and Urban Development.

The agreement requires the housing authority, known by the acronym NYCHA, to meet specific deadlines and benchmarks for addressing health and safety hazards including lead paint, mold and lack of heat. For example, NYCHA will have 30 days to “eliminate any lead-based paint hazards” in apartments where children under 6 live or regularly visit.

A new leader for the authority will be chosen to replace interim chairman Stanley Brezenoff.

Asked how the agreement differed from the consent decree that Pauley rejected, de Blasio said, “You will see this has a whole host of tangible goals on heat, vermin, lead, you name it. I think that’s an improvement for all of us.”

U.S. Attorney Geoffrey Berman said in a statement that the agreement goes beyond the earlier consent decree by providing “strict, enforceable standards that NYCHA must meet by particular deadlines for the five critical living conditions, including requiring both the immediate remediation of lead paint in apartments with children under 6 years old and, over time, 100 percent abatement of all lead paint in all NYCHA developments, as well as a change in NYCHA leadership.”

De Blasio has blamed years of neglect by the state and federal governments as well as previous mayoral administrations for NYCHA’s ills and insisted that a federal takeover would only make things worse. HUD said it expects to give the system $1.5 billion this year.

Watch the announcement: