CHRISTOPHER WEBER  / Associated Press

A federal judge this week gave final approval to a lawsuit settlement that commits the city of Los Angeles to sheltering or housing thousands of homeless residents within five years.

In approving the deal reached in April, U.S. District Judge David Carter wrote Tuesday that the agreement is “fair, reasonable, and adequate.”

The city’s settlement with the group LA Alliance for Human Rights commits Los Angeles to spending up to $3 billion to supply 16,000 beds or housing units for homeless people not suffering from mental illness.

The court will retain jurisdiction for a period of five years to create an “enforcement mechanism” for the pact, Carter said.

“While this agreement is not a solution to homelessness, it is a concrete step toward improving the lives of our neighbors who are currently suffering on the streets,” the judge wrote.

The lawsuit was brought in 2020 by the alliance, a coalition of business owners, residents, landlords, homeless people and others who alleged that inaction by city and county of Los Angeles created a dangerous environment.

The settlement draws a sharp distinction between the city’s responsibilities and those of Los Angeles County, which operates the local public health system. The county is also part of the lawsuit but has not settled. The alliance said in April that it would continue to pursue its lawsuit against the county.

The homeless population was once largely confined to downtown LA’s notorious Skid Row, but encampments have spread widely, including within sight of City Hall.

The Los Angeles City Council voted 12-3 in March to approve the settlement.

Under the agreement, the city would create shelter or housing for 60% of homeless people in the city who do not have a serious mental illness, substance abuse disorder or chronic physical illness.

The city’s actual housing commitment will be based on the 2022 point-in-time count of homeless people, the results of which are expected this summer. Last year’s count was canceled due to the COVID-19 pandemic. As of January 2020, there were more than 66,400 homeless people in Los Angeles County, with 41,000 within LA city limits.