The anti-Muslim extremist who confessed to a bombing and shooting massacre that killed 77 people in Norway tried to declare himself a resistance leader Monday at his first public court hearing but was quickly cut off by the judge.

Anders Behring Breivik was escorted by guards into an Oslo court room packed with dozens of reporters and spectators, including survivors of his rampage at a youth camp near the capital who were seeing him in person for the first time since the July 22 attack.

"I am a military commander in the Norwegian resistance movement," Breivik said before the judge interrupted him and told him to stick to the issue at hand — his further detention.

The court extended his custody 12 more weeks until Feb. 6, but decided to gradually lift the restrictions on his media access, visitors and mail. Breivik is being held pending his trial on terror charges.

If found guilty, he could be sentenced to 21 years in prison. An alternative custody arrangement — if he is still considered a danger to the public — could keep him behind bars indefinitely.

At the end of Monday's hearing, the 32-year-old Norwegian asked Judge Torkjel Nesheim if he could address survivors and victims' relatives but was turned down.