A federal judge in Washington ruled that a temporary U.S. ban on evictions in parts of the country hit hardest by the coronavirus can continue, a major victory for the Biden administration’s efforts to extend protections as the delta variant spreads.

In a ruling Friday, U.S. District Judge Dabney Friedrich rejected a plea by two landlord groups to block a moratorium by the Centers for Disease Control and Prevention that was set to last until Oct. 3. The decision extends protections against eviction that expired July 31 and were in doubt after the Supreme Court indicated in June that only Congress could continue the policy.

The ruling marks the latest twist in a months-long legal saga over how far the government can go to protect renters from losing their homes because of COVID-19, which has disrupted the economy, cost millions of people their jobs and left many property owners with billions of dollars in lost rental income.

The Biden administration said in an Aug. 6 court filing that an eviction freeze was necessary because “the trajectory of the pandemic has changed dramatically” as virus variants take hold. But tenant delinquencies in June were almost double from before the pandemic, owing about $24 billion, Moody’s Analytics estimates. Even after billions in rental assistance, landlords face a $26.6 billion shortfall, the National Apartment Association said.

In June, the Supreme Court ruled in a narrow 5-4 vote that an earlier version of the moratorium issued by the CDC was legal, after it had been challenged by landlords. But Justice Brett Kavanaugh, who cast the pivotal vote, argued at the time that any extension would require legislative action.

Congress failed to act, so the earlier ban expired. The Biden administration initially expressed reluctance to continue the moratorium, given the likelihood that it would be overturned in the courts.

That view drew widespread criticism from many Democrats who argued that the moratorium was necessary to protect renters as the number of COVID cases started rising again. Representative Cori Bush, a Missouri Democrat, camped outside the Capitol in a sleeping bag to protest the lapse of the moratorium, as renter advocacy groups lobbied the administration to act.

On Aug. 3, the CDC issued a new, limited version of the ban that applied only to U.S. counties where the spread of the virus is most severe. The agency said it wanted to buy more time to increase vaccination rates and allow local governments to distribute funds to people who’ve fallen behind on rent.

Congress has granted almost $47 billion in emergency rental assistance, but bureaucratic delays have kept some of that aid from reaching those in need.

The extension was a calculated risk. President Joe Biden acknowledged the legal uncertainty around the new moratorium, telling reporters he wasn’t sure whether it would hold up in court.

A day after the CDC announced the moratorium, two landlord groups — the Alabama Association of Realtors and the Georgia Association of Realtors — challenged it, seizing on Kavanaugh’s argument in the Supreme Court case.

“In substance and effect, the CDC’s latest action is an extension of the same unlawful ban on evictions that has been in effect since September 2020,” the groups said in their lawsuit.

Nationally, 5.6 million renters, or 13% of the total were behind on payments in June, according to Moody’s Analytics estimates.

Collectively, tenants owed about $24 billion in arrears, according to Moody’s, down from a peak of $52.6 billion in January.

While the federal moratorium covers about 90% of U.S. renters, some of the most populous cities and states have passed their own rules to prevent landlords from evicting tenants during the pandemic.