A federal judge has paused the planned firing squad execution of former Army Maj. Nidal Hasan, who was scheduled to die Thursday in Texas for killing 13 people in the 2009 Fort Hood attack. The government has filed a notice of appeal.

U.S. District Judge Tony Mattivi ruled Monday that Hasan should have more time to seek to halt his execution, which President Donald Trump approved. Mattivi ordered Hasan to file his petition by June 1 and said the government could not carry out the death sentence while the stay remained in effect.

“We are a nation of laws. Those laws protect everyone who comes before a court, including people convicted of the worst crimes. They apply with the same force even when the public would prefer a different result. The rule of law must be jealously guarded, and cases like this one test it most,” Mattivi wrote.

Hasan appeared in court Monday to argue that his military court death sentence violated his constitutional rights and that he needed more time to make his case. He admitted opening fire on fellow U.S. soldiers. Hasan is representing himself, with assistance from lawyers at the American Civil Liberties Union Capital Punishment Project.

The ACLU filed a request last week to pause the execution and begin federal habeas corpus review of whether Hasan’s conviction was constitutionally defective. The government appealed the judge’s decision.

“This decision affirms that the government cannot rush to carry out an execution at the expense of the integrity of our justice system,” Anna Arceneaux, deputy director of the Capital Punishment Project, said in a statement. “We recognize the unimaginable pain and loss that the Fort Hood community carries to this day. Even in such cases, the law is clear that people facing the death penalty must have a meaningful opportunity to pursue federal review of their legal claims.”

Mattivi wrote that the order did not diminish Hasan’s actions or the toll on victims and their families. “A court-martial found that he planned and carried out the murder of thirteen people, and every court to review that judgment has left it in place. The question now is narrower. It is what the law requires of this Court before the sentence is carried out.”

The Justice Department called the delay decision meritless and argued it would harm victims’ families. Attorney General Todd Blanche posted a copy of the government’s appeal notice on X, writing that “Hasan offers no justification for his delay” in filing his petition for judicial review, “nor can he establish any likelihood of success on the merits of his yet-unfiled petition.” The Defense Department referred questions to the Justice Department’s response.

Hasan is held at the military prison at Fort Leavenworth, Kansas. He is paralyzed from the waist down after being shot in the back during the attack. In 2010, he told military mental health experts he wanted to be executed so he could die as a “martyr.”

About a month before he was scheduled to go to Afghanistan in 2009, Hasan opened fire in a building crowded with soldiers preparing to deploy or returning to the U.S. More than 30 people were injured, in addition to the 13 killed.

At his 2013 trial, Hasan wanted to argue that the shooting was legally justifiable because he was defending the Afghan Taliban from an unlawful U.S. Army attack and wanted to stop Muslims from being killed by American soldiers. The judge rejected the argument. Hasan remained largely silent during the three-week trial. The military called nearly 90 witnesses; Hasan rested his case without calling anyone to testify in his defense and made no closing argument.

Prosecutors said Hasan’s self-defense claim was absurd because the soldiers he shot were not directly threatening anyone. Several were shot in the back as they tried to run away. “By Hasan’s own twisted logic, any person could unilaterally decide that a war was unlawful and engage in murderous mass shootings against U.S. military personnel with impunity, even before such personnel reached the battlefield,” prosecutors wrote in court papers.

Hasan plans to argue in his petition that the president and defense secretary did not follow military regulations, including by notifying him of the execution three days after signing the order and having a chaplain or attorney present when he was told. His lawyers are also asking the judge to ensure he remains at a prison that provides the continuing and significant medical care he needs.

The execution would have been the first carried out by the U.S. military since 1961 and the first by firing squad since World War II. Defense Secretary Pete Hegseth wanted to livestream it, but Trump overruled him.

Schools and local officials around the base in Killeen, Texas, had planned to close Thursday for the execution. Army regulations strictly limit witnesses to direct victims and survivors of the crimes Hasan was convicted of: 13 counts of murder and 32 counts of attempted murder. Some people who were told they could not attend said the Army should include people traumatized by the attack who survived without bullet wounds.