A federal judge on Monday paused the execution of Fort Hood shooter Nidal Hasan, three days before he was scheduled to face a military firing squad.

Following a hearing in Kansas City, Judge Anthony Mattivi ruled that Hasan can have more time to file a habeas corpus petition, which argues that his constitutional rights were violated during his 2013 military court trial. Hasan will have until June 1 to file the petition.

The federal government has filed a notice saying it will appeal the stay of execution. "Hasan offers no justification for his delay in filing a habeas petition, nor can he establish any likelihood of success on the merits of his yet-unfiled petition," U.S. Attorney General Todd Blanche said in a post on X responding to the ruling.

Hasan, who killed 12 soldiers and a civilian at Fort Hood in 2009, left the guarded walls of his military prison on Monday and appeared in court to ask the judge to stop his execution. He was surrounded by military police and wearing a bulletproof vest. Hasan, now 56, has been imprisoned at the United States Disciplinary Barracks at Fort Leavenworth, Kansas, since being condemned by an Army jury to die. He was convicted of murdering 13 people and attempting to murder 32 more.

Hasan's case returned to worldwide attention not only because of the graphic nature of his crimes, but also because of the graphic nature of his scheduled execution. Last month, President Donald Trump signed off on Hasan's death sentence, announcing he would be put to death by firing squad, a method of execution last used by the U.S. military during World War II.

In his ruling on Monday, Mattivi wrote that Hasan "did not delay" the process by filing for review a few days before his execution date. "Hasan seeks his first federal review of his death sentence, and without a stay the Army will execute him before any court can consider his claims," the judge said.

Hasan had been representing himself in court until Monday, when he told the judge he would instead use attorneys provided by the American Civil Liberties Union, which opposes all capital punishment. The ACLU said the decision "affirms that the government cannot rush to carry out an execution at the expense of the integrity of our justice system."

Some survivors of the Fort Hood shooting were on their way to Texas to witness the execution when they learned of the stay, including retired Master Sgt. Joy Clark, who was shot in the arm in the attack. Clark said she is frustrated by the stay, but believes it was the correct decision. "This is how our legal system works," she said. "Anyone who's got a death sentence absolutely needs to have the ability to have someone look at their case."

Retired Staff Sgt. Shawn Manning, who was shot six times in the attack, described the ruling as "unfortunate," pointing out that Hasan made the same arguments throughout his earlier appeals process that was ultimately denied by the Supreme Court.

The planned execution had drawn debate over its method and witnesses. Secretary of Defense Pete Hegseth said shortly after Hasan's date of death was set that the firing squad would be livestreamed to the public, drawing bipartisan criticism. President Trump later reversed that decision. In his latest court filings, Hasan argues that the president's public involvement in discussing the manner of his execution violates Army policy, which says the Secretary of the Army, not the president, is responsible for those decisions.

In his ruling, Mattivi said Hasan has the right to pursue his claim that President Trump could have improperly influenced decisions about the execution. "At least one of the claims he previews — that unlawful command influence and animus drove the approval of his sentence — arose after military review ended, and no military court can now hear it," the judge wrote.