A federal judge in Maryland restored the jobs of potentially tens of thousands of fired probationary federal employees late Thursday, ruling that the government unlawfully failed to give proper notice to the states before conducting mass layoffs.

The ruling means the federal government must take back the employees, at least for the immediate future.

The decision from Senior U.S. District Judge James K. Bredar is part of a temporary restraining order, or a short-term court order designed to maintain the status quo while a lawsuit proceeds. The temporary restraining order is set to last for two weeks, but Bredar will consider extending it during that period.

The order covers probationary employees who were fired from the following agencies: the departments of Agriculture, Commerce, Education, Energy, Health and Human Services, Homeland Security, Housing and Urban Development, Interior, Labor, Transportation, Treasury and Veterans Affairs, the Consumer Financial Protection Bureau, Environmental Protection Agency, Federal Deposit Insurance Corp., General Services Administration, Small Business Administration and United States Agency for International Development.

The Baltimore Banner thanks its sponsors. Become one.

In an emailed statement, White House Press Secretary Karoline Leavitt claimed inaccurately that Bredar is “attempting to unconstitutionally seize the power of hiring and firing from the Executive Branch.”

In fact, Bredar’s order does not prevent the executive branch from firing employees; it just requires the government to follow the law when it chooses to do so.

“If a federal district court judge would like executive powers, they can try and run for president themselves,” Leavitt said. “The Trump Administration will immediately fight back against this absurd and unconstitutional order.”

Bredar found that the firings were not, as the government claimed, based on individual assessments of employees’ performance, but part of a much more sweeping effort. That means the government was required to follow the rules Congress laid out for “reductions in force,” a process that offers greater protections for workers and gives states time to prepare.

“The record reflects that these probationary employees were not fired for cause,” Bredar wrote.

The Baltimore Banner thanks its sponsors. Become one.

“The government’s contention to the contrary borders on the frivolous.”

A White House spokesperson did not immediately respond to questions.

This is just the beginning of the lawsuit. The states will likely ask for a longer-term order, or an injunction, keeping the workers in their jobs while the case continues. Bredar’s ruling doesn’t prevent the government from pursuing a reduction in force in accordance with the law.

“This case isn’t about whether or not the government can terminate people,” Bredar, who was appointed by President Barack Obama, said at a hearing on the restraining order this week. “It’s about, if they decide to terminate people, how they must do it.”

A formal RIF would take much longer than the rapid, wholesale cuts that have occurred since President Donald Trump took office. It would also come with worker protections, according to the lawyer for the states. In a normal RIF, preference would be given to veterans, for example, and employees’ length of service would be considered.

The Baltimore Banner thanks its sponsors. Become one.

Thousands of Marylanders — state budget analysts project 28,000 — are expected to lose their jobs as the government slashes employees and programs.

Maryland Attorney General Anthony Brown is leading the lawsuit, which includes 19 states and the District of Columbia.

“These mass firings reflect a disregard for both the law and the essential role of the civil service in maintaining government stability,” Brown said in a statement. “Our Office is committed to upholding the rule of law and will take every necessary legal step to ensure compliance with this court order.”

The states argued that they were caught off guard by the sudden influx of laid-off workers, leaving them scrambling to provide unemployment benefits and workforce development opportunities. When the federal government conducts a reduction in force, it is supposed to give the states notice so that they can prepare.

That didn’t happen before the Trump administration began firing probationary federal workers, who have fewer job protections.

The Baltimore Banner thanks its sponsors. Become one.

An attorney for the federal government argued at a hearing this week that the employees were terminated because of performance issues, though he also acknowledged that some workers may have been deemed unfit for jobs because government agencies no longer wanted those jobs to exist.

The federal government is allowed to terminate probationary employees for performance reasons, but Bredar suggested at the hearing that it was “implausible” that these employees had all been individually assessed.

And since the firings were, legally, a reduction in force, the government was required to follow the rules set out by Congress, Bredar found.

Bredar was the second judge on Thursday to rule that the administration must reinstate thousands of fired federal workers. A federal judge in California also ordered six agencies to rehire probationary employees, calling the government’s claim that they were terminated over performance issues “a sham.”