INDIANAPOLIS (AP) -- American-born Taliban fighter John Walker Lindh says a federal prison rule barring him and other Muslims from praying together daily is "absurd" and contends the U.S. is causing him to sin against his religion by prohibiting such gatherings in the name of security.

Lindh testified Monday in U.S. District Court in Indianapolis during a trial in a civil lawsuit seeking to overturn the prison policy, which he argues violates a 1993 law barring the government from curtailing religious expression without showing it has a compelling interest.

Lindh, who is serving a 20-year sentence for aiding Afghanistan's Taliban government before its overthrow, is one of 43 inmates housed in a closely monitored unit at the federal prison in Terre Haute. Twenty-four of them are Muslim.

Inmates in the tightly controlled Communications Management Unit -- one of only two in the country -- are allowed to eat, talk, play cards and exercise as a group, but praying together is limited to once a week except during the Islamic holy month of Ramadan. Most days, they must pray alone in their individual cells.

Gatherings by other faiths also are limited.

Lindh, 31, said the restrictions violate his school of Islam, which requires group prayer five times a day, if possible.

"I believe it's obligatory," Lindh said of the daily group prayer. "If you're required to do it in congregation and you don't, then that's a sin."

The government maintains that preserving security in the unit, where inmates' contact with the outside world is sharply restricted and most of their movements are under audio and video surveillance, makes it necessary to limit group activities, including prayer.

"There are no legitimate security risks by allowing us to pray in congregations," Lindh said. "It's absolutely absurd."

Monday's courtroom appearance was a rare one for Lindh, who has been held at the Terre Haute prison since 2007.

A cluster of openly armed U.S. marshals escorted the shackled Lindh into the federal courtroom in downtown Indianapolis. The bushy-bearded Lindh, who wore an olive green prison uniform and a white prayer cap, smiled at his mother, who sat in the third row and offered a strained smile back at him. Four of the marshals stood a few feet away while Lindh sat at a table with his attorneys from the American Civil Liberties Union of Indiana.

He was soft-spoken throughout most of his testimony but became agitated when Deputy U.S. Attorney William McCoskey asked him why he had not stood along with everyone else when Judge Jane Magnus-Stinson entered the courtroom.

"It's against my religion," Lindh said. "This procedure of standing up for people is unacceptable."

He also said he didn't acknowledge the government's authority to restrict his religious practices.

"I don't recognize any law but the Sharia of Islam," Lindh said in response to questioning by government attorneys. "There is no compromise."

Prisoners in the unit can talk to their attorneys without being monitored, but their other phone calls are under surveillance. The inmates also are not allowed to touch family members during visits. Without such strong security, the government claims, prisoners would be able to conspire with outsiders to commit terrorist or criminal acts.

The government claims in court documents that Lindh delivered a radical sermon to other Muslim prisoners in February. It also says he delivered the sermon entirely in Arabic, which is not allowed under Bureau of Prison regulations that require all speech but ritual prayers to be in English.

Michael R. Smith, chief chaplain for the Bureau of Prisons, testified that officials decided group religious services must be supervised following a 2004 report by the Inspector General's Office on concerns about efforts to radicalize Muslim inmates after 9/11.

The lawsuit seeking to overturn the prison prayer rule was originally filed in 2009 by two Muslim inmates in the unit. Lindh joined the lawsuit in 2010, and the case has drawn far more attention since then. The other plaintiffs have dropped out as they were released from prison or transferred to other units.

Lindh was originally charged with conspiring to kill Americans and support terrorists, but those charges were dropped in a plea agreement. He is eligible for release in 2019.