The judge Myong Joun also orders the department to re-employ employees who have lost their jobs.
The message is a setback for one of the promises Trump made during the presidential campaign.
The Minister of Education Linda McMahon has previously been tasked with taking "all necessary measures" to be able to shut down the department and transfer it to the states.
Previously, 4,100 people were employed at the department, many of whom have already been laid off.
According to the Trump administration, the goal of the layoffs is efficiency, not to shut down the department entirely. The President wants it to be shut down, but knows it's something that needs to be implemented by the government, according to the government.