A federal judge in California late Thursday blocked the Trump administration from stopping the 2020 Census count next week instead of Oct. 31 as the bureau had planned, saying the plaintiffs had proved the government’s truncated schedule could lead to an inaccurate count.

U.S. District Judge Lucy Koh in the Northern District of California granted a preliminary injunction in the case brought by the National Urban League and a group of counties, cities, advocacy groups and individuals. Koh had, earlier this month, issued a temporary restraining order to continue the count, which has been beset this year by the coronavirus pandemic, natural disasters and legal tussling. The case is likely to be appealed to the U.S. Supreme Court.

House Speaker Nancy Pelosi (D-Calif.) in a statement called the ruling “a victory for our Constitution and American Democracy,” and plaintiffs called it a win for people in harder-to-count communities who may have been missed under a rushed count.

“The court’s decision affirms our contention that changes to the census schedule will irreparably harm the integrity of the 2020 Census and result in a devastating undercount of vulnerable communities,” said Marc H. Morial, the NUL’s president and chief executive. “Career officials at the Census Bureau opposed the shortened schedule precisely for these reasons, and to avoid the perception of political manipulation, and we are confident that integrity and equity will win out over the partisan vandalism that threatens our democracy.”

Melissa Arbus Sherry, an attorney with Latham & Watkins who argued the case, said in a statement: “As the Court recognized, the Census Bureau has itself repeatedly recognized that a full, fair, and accurate count takes time, especially when faced with a historic pandemic. Every day that the 2020 Census count continues, and Census operations appropriately continue, will help ensure the accuracy and completeness of this once-in-a-decade tally.”

The Justice and Commerce departments did not respond to requests for comment.

In her ruling, Koh found that the government’s explanation for why it had shortened the timeline ran “counter to the facts.”

Justice Department lawyers had argued that the government had truncated the count in response to Congress’s failure to act on the bureau’s earlier request to extend the statutory deadline for delivering the data. The House approved the four-month delay in its May coronavirus relief bill but the Senate has yet to approve it.

But Koh found that even as Congress was taking “major steps” toward extending the deadline, the Commerce Department was already pressuring the bureau to accelerate the count.

Internal documents released during the lawsuit showed career bureau officials strategizing how to resist the pressure, calling it “ludicrous to think we can complete 100% of the nation’s data collection earlier than 10/31,” and saying “any thinking person who would believe we can deliver apportionment by 12/31 has either a mental deficiency or a political motivation.”

On Aug. 3, the government abruptly announced a “Replan” in which the count would end Sept. 30, a month before the date it had originally requested, and that the data would be reported by the end of the year, while President Trump was still in office, instead of the original deadline of April 30.

Koh referred to a July 29 House Oversight and Reform hearing at which bureau director Steven Dillingham did not support extending the deadline but rather “sidestepped questions” about whether the administration had reversed its position.

“Accordingly, Defendants’ explanation — that the Replan was adopted in order to meet the December 31, 2020 statutory deadline because Congress failed to act — runs counter to the facts,” she wrote. “Those facts show not only that the Bureau could not meet the statutory deadline, but also that the Bureau had received pressure from the Commerce Department to cease seeking an extension of the deadline.”

The evidence supported the plaintiffs’ claim that the government’s decision was “arbitrary and capricious,” in violation of the Administrative Procedure Act, according to the ruling. “Single-mindedly sacrificing” a complete and accurate census in order to meet a congressionally mandated deadline “can itself violate the APA,” she wrote.

The ruling also found that the jurisdictions and groups that had filed the suit would suffer irreparable harm from an inaccurate census, including a loss of federal funding and Congressional representation, both of which are determined by decennial census data.

A federal court in Maryland is expected to rule soon on a similar challenge to the shortened schedule.

This week, the Trump administration also asked the Supreme Court to overturn or expedite a review of a separate ruling against a memo from the president that said undocumented immigrants should be excluded when using census data for allocating congressional seats to the states.

Census workers have told The Washington Post and watchdog groups that they were instructed to cut corners in recent weeks in the rush to meet the shortened deadline.

On Thursday, House Oversight Committee Chairwoman Carolyn B. Maloney (D-N.Y.) sent a letter to Dillingham asking about leaked documents that appear to show the bureau breaking or changing its rules for the enumeration of homeless people in order to finish the count by Sept. 30. Dillingham said bureau officials would answer her questions Friday in a regularly scheduled briefing.

Maloney and other lawmakers have expressed concern about the change in schedule, saying a rushed count would hurt communities in both Democratic and Republican states.

A bipartisan Senate bill introduced this month by Brian Schatz (D-Hawaii), Lisa Murkowski (R-Alaska) and Dan Sullivan (R-Alaska) would extend the count through at least Oct. 31 and extend the data reporting deadline by four months. Census experts say post-count analysis and adjustments are key to an accurate count; the government’s Replan would have shortened it from six months to three months. A date extension approved by lawmakers could be vetoed by the president but still could add weight to challenges in court.

Otherwise, an expected appeal of Koh’s decision by the government “continues uncertainty” for field operations, Vanita Gupta, president and chief executive of the Leadership Conference on Civil and Human Rights, said in a tweet Friday. “It’s why Congress must still act.”