CNN
 — 

A military judge ruled on Wednesday that plea agreements between the alleged 9/11 conspirators at Guantanamo Bay and the US government are “valid and enforceable,” a defense official told CNN – roughly three months after Defense Secretary Lloyd Austin revoked the deals.

The ruling allows for the plea deals to go forward and could mean the men will eventually be sentenced to life in prison and avoid death sentences.

The US reached a plea deal with alleged 9/11 mastermind Khalid Sheikh Mohammed and two other defendants accused of plotting the attacks in July after more than two years of negotiations. But just days later, Austin revoked the plea deals and yanked responsibility from the convening authority for military commissions who runs the military courts at Guantanamo.

“Part of his ruling was not only are they legal and enforceable,” the defense official told CNN, “but that [Austin] was too late in doing that.”

Pentagon spokesman Maj. Gen. Pat Ryder said Wednesday that as Austin’s memo said in August, “the Secretary determined that the decision on whether to enter into a pretrial agreement in the 9/11 military commission cases is one of such significance that it was appropriate for responsibility to rest with him as the superior convening authority.”

“We are reviewing the decision and don’t have anything further at this time,” Ryder said in a statement.

The New York Times first reported on the judge’s ruling.

Austin said at the time he was withdrawing from the pre-trial agreements, which were taking the death penalty off the table for Mohammed, also known as KSM, and Walid Bin ‘Attash and Mustafa Ahmed Adam al Hawsawi. The deals had prompted a fierce backlash, including from both sides of the political aisle and some groups representing 9/11 victims who have pushed for the US government to pursue the death penalty.

At pre-trial hearings just days after Austin’s revocation of the plea deal, the defendants’ attorneys argued that Austin’s decision was “corrupt” and violated the military’s own commission regulations that say the convening authority can withdraw a pretrial agreement before the accused begins “performance of promises.” Attorneys argued that their clients had already begun those performances.

“We have had an unprecedented act by a government official to pull back what was a valid agreement. … For us, it raises very serious questions about continuing to engage in a system that seems so obviously corrupt and rigged,” Walter Ruiz, defense counsel for Hawsawi, said at the time.

The defense official said that the government prosecutors in the 9/11 trials “did not expect” the judge’s ruling on Wednesday.

Experts said this summer that the plea deal could have been the best option to avoid a long and drawn out trial against the conspirators, particularly Mohammed.

“They were still in pre-trial hearings,” Peter Bergen, a terrorism expert and CNN national security analyst, said at the time. “Getting some kind of deal is better.”

The military trial against Mohammed and his alleged co-conspirators has been delayed for years as the US tried to determine how to handle the issue of torture used against Mohammed and others at secret CIA prisons in the 2000s. The issue posed a legal problem for prosecutors about whether evidence obtained through torture was admissible in court.

While the terms of the pre-trial agreement have not been made public, attorneys for the defendants said at the hearings in August that detainees would have answered questions from families of 9/11 victims as a part of the deal. Gary Sowards, a defense attorney for Mohammed, said in court that families had already begun “submitting questions in good faith.”

Wells Dixon, a senior staff attorney at the Center for Constitutional Rights who represented Majid Khan at Guantanamo Bay — another detainee, who was convicted on terrorism charges in 2012 — told CNN in August that it was highly unlikely prosecutors ever achieved a death penalty sentence. Largely in part, he said, because the government is “unwilling” to admit evidence in trial “about the defendant’s torture.”

“If Secretary Austin says that a 9/11 case is going to proceed to trial, and a verdict, and possibly a sentencing,” Dixon told CNN, “then he is either hopelessly ill-informed or is lying to victim family members.”

This story has been updated with additional details.

CNN’s Oren Liebermann and Lauren del Valle contributed to this report.