The U.S. District Court of Maryland ruled on Thursday that all probationary federal employees fired as part of President Donald Trump’s sweeping layoffs must be reinstated by Monday.

Chief judge James Bredar wrote in his ruling that the Trump administration was unlawful in laying off probationary federal employees, those typically in the first year or two of employment, without giving them proper notice.

The temporary order reinstates potentially tens of thousands of federal workers from nearly all executive departments — excluding the defense, justice and state departments — and agencies including the Consumer Financial Protection Bureau, the Environmental Protection Agency and the U.S. Agency for International Development, according to Bredar’s ruling.

In recent weeks, Trump and Elon Musk’s Department of Government Efficiency have told federal agencies to prepare for large-scale layoffs to cut spending, according to the Associated Press.

On Tuesday, the U.S. Department of Education announced that it would place about half of its about 4,100-person workforce on administrative leave beginning March 21.

[U.S. education department to cut workforce in half]

Bredar wrote that the federal government’s justification for the mass firings — individual performance-based reasons – did not have basis.

“Agencies are, of course, permitted to terminate probationary employees. That is not what this case is about,” Bredar wrote in a 56-page memo attached to his ruling “The sheer number of employees that were terminated in a matter of days belies any argument that these terminations were due to employees’ individual unsatisfactory performance or conduct.”

More than 11,000 federal employees have already been laid off in Maryland and about 17,000 more are expected to be laid off in the future, according to a presentation from state officials last week.

The ruling comes after another federal judge from San Francisco also ordered the Trump administration to reinstate the tens of thousands of laid off employees on Thursday, the Associated Press reported.

The two-week order is set to expire on March 27, but the court “will likely consider” an application to extend the injunction, Bredar wrote.