California will ban evictions for unpaid rent through the end of September and pay off all back rent for eligible tenants under a deal announced Friday by Gov. Gavin Newsom and legislative leaders.

California banned evictions after Newsom imposed the nation’s first statewide shutdown in March 2020 and ordered most businesses to close and people to stay home to slow the spread of the coronavirus.

Those protections are scheduled to expire Wednesday. The new agreement will extend the eviction moratorium through Sept. 30 and pledges to pay off all unpaid rent from April 2020 through Sept. 30 of this year for people who earn 80% or less of their area’s median income.

The money to pay for this, $5.2 billion, comes from the federal government.

People who are not eligible for the money can still qualify for the eviction ban if they pay at least 25% of what they owe by Sept. 30. Since those tenants still will be behind on rent landlords can take them to court to recover what’s left. But landlords can’t evict them for it.

“Our housing situation in California was a crisis before COVID, and the pandemic has only made it worse—this extension is key to making sure that more people don’t lose the safety net helping them keep their home,” said Senate President Pro Tempore Toni Atkins, a Democrat from San Diego. “While our state may be emerging from the pandemic, in many ways, the lingering financial impact still weighs heavily on California families.”

Newsom, who will face a recall election later this year fueled by criticism of his handling of the pandemic, said in a news release he is thankful for the legislative proposal, “which I am eager to sign into law as soon as I receive it.”

California has some of the most expensive rents in the country affordable and an housing shortage. About 25% of California’s renters pay at least half of their income on housing costs, a figure that includes rent and utilities, according to the California Department of Finance.

The extension gives state officials more time to disburse the money. A report from the California Department of Housing and Community Development showed the state had received $490 million in requests but had paid just $32 million covering 2,500 households as of May 31. That figure does not include some of the state’s larger cities, which run their own rental assistance programs.

California Apartment Association CEO Tom Bannon said California would not have to extend the eviction moratorium if it were able to spend money faster.

“It’s unacceptable that state and local governments have distributed less than 15% of the billions of dollars earmarked for California rental assistance,” said Bannon, whose organization represents landlords. “California has got to distribute these dollars faster so that the eviction moratorium being introduced is the last.”

Editor’s note: This story has been updated to say that people who make less than 80% of the area median income do not have to pay any portion of what they owe to be eligible for the money.

Long Beach extends deadline to apply for emergency rental assistance until July 11