A federal judge on Friday gave the government 30 days to start allowing American Taliban fighter John Walker Lindh and other Muslim inmates to hold group prayers outside their cells in a high-security prison in Indiana.

In a seven-page order, Judge Jane Magnus-Stinson said the Bureau of Prisons might have misconstrued her ruling seven months ago that granted Lindh’s request to hold group prayers in the Terre Haute federal prison’s Communications Management Unit, so she made her intent clear.

“The warden is to allow group prayer during every Muslim prayer time for which the inmates are not confined to their cells,” she wrote in bold print.

“Put simply, just as inmates are free to assemble, socialize and engage in other group activities in common, recreational areas during times they are released from their cells, so too must they be allowed to engage in group prayer in common, out-of-cell areas,” Magnus-Stinson said.

In her January order, the judge said Lindh sincerely believed Muslims are required to pray together five times a day at times set by a religious calendar. She found the prison’s restrictions on prayer violated a 1993 law banning the government from curtailing religious speech without showing a compelling interest.

Following the Jan. 11 order, the warden at first set aside a common room for prayer three times daily, but later revoked that and currently allows only two Muslims at a time to pray together inside a cell.

Lindh, who is represented by the American Civil Liberties Union, filed a contempt motion in April. But Magnus-Stinson said she couldn’t grant that because the wording of her original order might have been ambiguous.

The judge said the warden was free to deny group prayer to anyone who abused that right.

“This is exactly what we asked for,” ACLU of Indiana legal director Ken Falk said in an email Friday.

Bureau of Prisons spokesman Chris Burke said Friday the agency hadn’t reviewed the ruling and had no immediate comment.

The CMU is a self-contained unit housing high-risk inmates such as terrorists, whose contact with the outside world is sharply restricted.

U.S. troops captured Lindh in Afghanistan in 2001. Lindh, who grew up in California and was raised Catholic, was accused of fighting for the Taliban to help them build a pure Islamic state. In 2002, he pleaded guilty to supplying services to the now-defunct Taliban government and carrying explosives for them. He is eligible for release from prison in 2019.

The group prayer lawsuit originally was filed in 2009 by two Muslim inmates. The case drew far more attention after Lindh joined it in 2010. The other plaintiffs dropped out as they were released from prison or transferred to other units.