The Obama administration will not halt federal funding to North Carolina — at least until the looming court battle over the state’s “bathroom bill” is finished, a White House spokesman said Thursday.

Press Secretary Josh Earnest told reporters at a regular media briefing that the Justice Department’s decision to sue over the law — which bans transgender people from using bathrooms that don’t match the gender on their birth certificates — had spurred the administration to put on hold any decision about stripping North Carolina of federal money.

“The administration will not take action to withhold funding while this enforcement process is playing out in the courts,” Earnest said.

That decision is significant since it gives North Carolina at least a reprieve from the threat of losing billions of dollars in education and other funding. No matter how the administration responded, though, the high-profile dispute was always likely to be resolved in court. On Monday, North Carolina and the Justice Department announced dueling lawsuits over the bill — with the state asserting the Justice Department was reaching too far and that its legislation was not discriminatory, and the Justice Department firing back that North Carolina was violating federal civil rights law.

The court battle could be a long one, as each side must serve the other with summonses and make more detailed arguments in written filings. As of Thursday, no definitive hearing or briefing schedule had been set.

Josh Ellis, the communications director for Republican Gov. Pat McCrory, said in a statement: “As Governor McCrory has said all along, his administration’s assertive action against Washington overreach will protect federal funding for schools and other services while allowing the courts to resolve this issue.” McCrory has previously defended the measure as a commonsense way to protect people’s privacy.

Republican State Senate President Phil Berger said: “Today the Obama administration admitted what we have said all along — that their threat to withhold funding and bully North Carolinians into accepting their radical argument that men have a ‘civil right’ to use women’s bathrooms and shower facilities would have to be settled in court. We appreciate the Republican members of North Carolina’s U.S. House delegation for standing up for common sense and making clear that any attempt to withhold federal funding is without legal merit and would be an unprecedented overreach by the federal government.”

At least six federal agencies had been weighing whether to withhold funds from North Carolina in response to the law, though Earnest said at the briefing that review was separate from the Justice Department’s conclusion that North Carolina’s law violated the Civil Rights Act of 1964. It was based on that conclusion that the Justice Department sued North Carolina after first warning him that his state was running afoul of federal law.

“It is clear that the decision on the part of the Department of Justice to move forward with enforcement means that while the process plays out, the administration will not be taking action to withhold funding,” Earnest said.

White House officials remain confident they will prevail in court, prompting North Carolina officials to reverse themselves rather than face the loss of billions in federal aid. Other state officials, in Illinois and elsewhere, have changed their policies on transgender students’ access to facilities rather than lose Education Department funding.

North Carolina receives more than $4 billion in federal education funding each year, much of it in the form of student loans, so a decision to strip funding in that area could be especially significant. The University of North Carolina’s Board of Governors held a special meeting Tuesday to get legal advice, and its president has said the UNC system finds itself caught between state and federal demands. A U.S. Education Department spokesman said Thursday its review was ongoing.

Ford Porter, a spokesman for the gubernatorial campaign of North Carolina Attorney General Roy Cooper (D), said in a statement Thursday that the federal government’s decision was “good news,” but criticized McCrory for “continuing to put billions in funding at risk.” [Cooper, who has said he won’t defend the bathroom bill, is running against McCrory in November.]

“North Carolinians shouldn’t have to miss out on essential funding for our schools and our roads because of this discriminatory law,” Porter said in the statement.

Even before the dueling lawsuits, the law had sparked controversy across the country, including heated opposition from business groups and a host of major companies. At least two — PayPal and Deutsche Bank — said they were scrapping planned expansions in North Carolina because of the law, moves that would cost the state hundreds of jobs as well as millions of dollars that state officials had said the companies would bring to the local economies.

At a news conference earlier this week, U.S. Attorney General Loretta E. Lynch linked the bill with a dark legacy that included Jim Crow laws and resistance to the Brown v. Board of Education decision.

“It was not so very long ago that states, including North Carolina, had signs above restrooms, water fountains and on public accommodations keeping people out based upon a distinction without a difference,” she said.

Emma Brown and Mark Berman contributed to this report.