WASHINGTON — The Supreme Court on Thursday rejected the Biden administration’s latest moratorium on evictions, ending a political and legal dispute during a public health crisis in which the administration’s shifting positions had subjected it to criticism from adversaries and allies alike.

The court issued an eight-page majority opinion, an unusual move in a ruling on an application for emergency relief. The court’s three liberal justices dissented.

The decision puts hundreds of thousands of tenants at risk of losing shelter, while the administration struggles to speed the flow of billions of dollars in federal funding to people who are behind in rent because of the coronavirus pandemic and its associated economic hardship. Only about $5.1 billion of the $46.5 billion in aid had been disbursed by the end of July, according to figures released on Wednesday, as bureaucratic delays at the state and local levels snarled payouts.

The majority opinion, which was unsigned, said the Centers for Disease Control and Prevention had exceeded its authority.

“The C.D.C. has imposed a nationwide moratorium on evictions in reliance on a decades-old statute that authorizes it to implement measures like fumigation and pest extermination,” the opinion said. “It strains credulity to believe that this statute grants the C.D.C. the sweeping authority that it asserts.”

Justice Stephen G. Breyer, writing for the three dissenting justices, faulted the court for its haste during a public health crisis.

“These questions call for considered decision-making, informed by full briefing and argument,” he wrote. “Their answers impact the health of millions. We should not set aside the C.D.C.’s eviction moratorium in this summary proceeding.”

The administration had at first concluded that a Supreme Court ruling in June had effectively forbidden it from imposing a new moratorium after an earlier one expired at the end of July. While the administration had prevailed in that ruling by a 5-to-4 vote, one member of the majority, Justice Brett M. Kavanaugh, wrote that he believed the moratorium to be unlawful and that he had cast his vote to temporarily sustain it only to allow an orderly transition. He would not support a further extension without “clear and specific congressional authorization (via new legislation),” he wrote.

Congress did not act. But after political pressure from Democrats, a surge in the pandemic and new consideration of the legal issues, the administration on Aug. 3 issued the moratorium that was the subject of the new ruling.

Congress declared a moratorium on evictions at the beginning of the coronavirus pandemic, but it lapsed in July 2020. The C.D.C. then issued a series of its own moratoriums, saying that they were justified by the need to address the pandemic and authorized by a 1944 law. People unable to pay rent, the agency said, should not be forced to crowd in with relatives or seek refuge in homeless shelters, spreading the virus.

The last moratorium — which was put in place by the C.D.C. in September and expired on July 31 after being extended several times by Congress and Mr. Biden — was effective at achieving its goal, reducing by about half the number of eviction cases that normally would have been filed since last fall, according to an analysis of filings by the Eviction Lab at Princeton University.

But landlords have said that the moratoriums saddled them with billions of dollars in debt. The challengers in the current case — landlords, real estate companies and trade associations led by the Alabama Association of Realtors — argued that the moratorium was not authorized by the law the agency relied on, the Public Health Service Act of 1944.

That law, the challengers wrote, was concerned with quarantines and inspections to stop the spread of disease and did not bestow on the agency “the unqualified power to take any measure imaginable to stop the spread of communicable disease — whether eviction moratoria, worship limits, nationwide lockdowns, school closures or vaccine mandates.”

The C.D.C. responded that the moratorium was authorized by the 1944 law. Evictions would accelerate the spread of the coronavirus, the agency said, by forcing people “to move, often into close quarters in new shared housing settings with friends or family, or congregate settings such as homeless shelters.”

The moratorium, the administration told the justices, was broadly similar to quarantine. “It would be strange to hold that the government may combat infection by prohibiting the tenant from leaving his home,” its brief said, “but not by prohibiting the landlord from throwing him out.”

The case was complicated by congressional action in December, when lawmakers briefly extended the C.D.C.’s moratorium through the end of January in an appropriations measure. When Congress took no further action, the agency again imposed moratoriums under the 1944 law.

In its Supreme Court brief, the government argued that it was significant that Congress had embraced the agency’s action, if only briefly.

The central legal question in the case was whether the agency was entitled to act on its own. In June, with the earlier moratorium about to expire, the court voted 5 to 4 in favor of the administration, allowing that measure to stand.

But that victory was distinctly provisional. Justice Kavanaugh, who voted with the majority, wrote that he had cast his vote reluctantly and had taken account of the then-impending expiration of the earlier moratorium.

“The Centers for Disease Control and Prevention exceeded its existing statutory authority by issuing a nationwide eviction moratorium,” Justice Kavanaugh wrote. “Because the C.D.C. plans to end the moratorium in only a few weeks, on July 31, and because those few weeks will allow for additional and more orderly distribution of the congressionally appropriated rental assistance funds, I vote at this time to deny the application” that had been filed by the challengers.

Justice Kavanaugh added that the agency could not extend the moratorium on its own. “In my view,” he wrote, “clear and specific congressional authorization (via new legislation) would be necessary for the C.D.C. to extend the moratorium past July 31.”

The other members of the court did not give reasons for their votes in the June ruling. But four of them — Justices Clarence Thomas, Samuel A. Alito Jr., Neil M. Gorsuch and Amy Coney Barrett — voted to lift the earlier moratorium. Taken together with Justice Kavanaugh’s statement, that distinctly suggested that a majority of the justices would not look favorably on another extension unless it came from Congress.

The Biden administration initially seemed to share that understanding, urging Congress to act and saying it did not have the unilateral power to impose a further moratorium through executive action. When Congress failed to enact legislation addressing the issue, the moratorium expired.

Under pressure from Speaker Nancy Pelosi and other Democrats and wary of the rise of the Delta variant, the administration reversed course a few days later.

The new moratorium was not identical to the earlier one, which had applied nationwide. It was instead tailored to counties where Covid-19 was strongest, a category that currently covers some 90 percent of counties in the United States.

Mr. Biden was frank in discussing his reasoning, saying the new measure faced long odds but would buy tenants some time.

“The bulk of the constitutional scholarship says that it’s not likely to pass constitutional muster,” he said on Aug. 3. “But there are several key scholars who think that it may — and it’s worth the effort.”

Two days later, he offered further thoughts.

“Here’s the deal,” he said. “I can’t guarantee you the court won’t rule if we don’t have that authority, but at least we’ll have the ability, if we have to appeal, to keep this going for a month at least — I hope longer than that.”

The moratoriums deferred but did not cancel the obligation to pay rent, but the challengers wrote that this “massive wealth transfer” would “never be fully undone.” Many renters, they wrote, would be unable to pay what they owed. “In reality,” they wrote, “the eviction moratorium has become an instrument of economic policy rather than of disease control.”

Even before the Supreme Court ruling, data released by the Census Bureau on Wednesday estimated that 1.2 million households were very likely to face eviction for nonpayment of rent over the next two months.

Still, many states and localities, including New York and California, have extended their own moratoriums, providing another layer of protection for some renters. In some places, judges, aware of the potential for large numbers of people to be put out on the street even as the pandemic intensifies again, have said they would slow-walk cases and make greater use of eviction diversion programs.