A federal district court in California on Tuesday ordered the U.S. Department of Homeland Security (DHS) to immediately reinstate DACA, in a lawsuit brought by former DHS Secretary Janet Napolitano against current DHS Secretary Kirstjen Nielsen.

President Barack Obama announced the DACA amnesty program in 2012, which Napolitano then unveiled as a DHS program for 800,000 illegal aliens who first arrived in America at a young age. In 2014, the Obama administration announced a new, broader amnesty program, called DAPA, covering over four million illegal aliens of all ages.

In 2015, the U.S. Court of Appeals for the Fifth Circuit in New Orleans held that the DAPA amnesty was unlawful, striking it down. When Justice Antonin Scalia died, the Supreme Court deadlocked 4-4 on the issue, leaving it in limbo during the presidential election.

When President Donald Trump was inaugurated, Attorney General Jeff Sessions took over the U.S. Department of Justice (DOJ). Sessions immediately dropped the DAPA appeal, and then-DHS Secretary John Kelly fully rescinded DAPA in June 2017.

On September 4, Sessions issued a legal analysis that, for the same reasons DAPA was illegal, DACA likewise violated federal law. DHS then rescinded DACA on September 5, and began winding down the program.

Five lawsuits were filed in U.S. District Court for Northern California to reinstate DACA, with the lead case brought ironically by none other than Napolitano, who is now the president of the University of California. The cases were assigned to Judge William Alsup, a liberal Clinton-appointed judge who formerly clerked for the Supreme Court and served in the Clinton-era DOJ.

Alsup originally issued extraordinarily broad and invasive discovery orders to force the federal government—even the White House—to disclose a broad range of sensitive documents on DACA discussions, possibly including communications with President Trump that would be protected by executive privilege.

When the U.S. Court of Appeals for the Ninth Circuit in San Francisco did not rein in Alsup, Sessions’ top Supreme Court lawyer, Solicitor General Noel Francisco, went straight to the Supreme Court, which rejected Alsup’s order in a unanimous opinion.

Back in the federal trial court, Alsup’s latest decision rejected DOJ’s motion to dismiss the five lawsuits. Instead, he issued a preliminary injunction against the Trump administration, ordering the Trump administration, “pending final judgment herein or other order, to maintain the DACA program on a nationwide basis on the same terms and conditions that were in effect before the rescission on September 5, 2017.” The San Francisco-based district court further ordered the federal government to begin renewing work permits for DACA recipients.

DOJ can now take these cases back to the Ninth Circuit on an expedited basis, and request a stay of the district court’s reinstatement order while the appeal is ongoing. If the Ninth Circuit declines again to do so, then DOJ can immediately return to the Supreme Court and ask Justice Anthony Kennedy—who has jurisdiction over the Ninth Circuit—to issue a stay that will last until a final decision is rendered in the appeal.

The lead case is Regents of the Univ. of Calif. v. U.S. Dept. of Homeland Security, No. 3:17-cv-5211 in the U.S. District Court for the Northern District of California.

Ken Klukowski is senior legal editor for Breitbart News. Follow him on Twitter @kenklukowski.