Desperate to prove he is not insane, mass killer Anders Breivik today claimed questions about his mental health were part of racist plot to discredit his extreme anti-Muslim ideology.

Breivik, who has admitted to killing 77 people in a bombing and youth camp massacre, said that no one would have asked for a psychiatric examination had he been a "bearded jihadist."

"But because I am a militant nationalist, I am being subjected to grave racism," he said. "They are trying to delegitimise everything I stand for."

Breivik rejects criminal guilt for the rampage on July 22, saying the victims had betrayed their country by embracing immigration.

Even the defence admits there is no chance of an acquittal, so the key issue to be determined in the trial is whether Breivik is criminally insane.

Two psychiatric examinations reached opposite conclusions on that point. Breivik himself insists he is sane, and accuses the prosecutors of trying to make him look irrational.

"I know I'm at risk of ending up at an insane asylum, and I'm going to do what I can to avoid that," he told the Oslo court.

Breivik became defensive as prosecutors quizzed him about sections of the 1,500-page manifesto he posted online before the attacks. It describes uniforms, medals, greetings and codes of conduct for the "Knights Templar" militant group that he claims to belong to. Prosecutors don't believe it exists.

In one section, read by prosecutor Svein Holden, Breivik speculated that in his future society, the loyalty of potential knights might be tested by asking them to undergo surgical amputation and castration. Breivik chastised the prosecutor for what he called "low blows" and said the segment was taken out of context.

Breivik, 33, showed no remorse as he continued his shocking testimony about his shooting spree at the annual summer youth camp of the governing Labor Party.

Calling the rampage "necessary," Breivik compared being shunned by those close to him to the grief of the bereaved.

"The only difference was that for my part it was a choice," he said.

The self-styled crusader apologised to the family of a pub owner who was among the eight people killed in the blast outside the government offices in Oslo, saying it was not his intention to kill "civilians."

Holden asked him if he wanted to express a similar apology to the families of the other victims, including the 69 killed on the youth camp on Utoya island.

"No I don't," Breivik said. "Utoya is a political indoctrination camp."

"I see all multicultural political activists as monsters, as evil monsters who wish to eradicate our people, our ethnic group, our culture and our country," he said.

Jon Hestnes, who heads a support group for victims' families and survivors, said afterwards it was "gruesome" to listen to Breivik's apology.

"It's an insult to the 76 other people who actually died because of that man," he said.

"He's not in our world. He isn't, and he doesn't have humanity at all. The way I slap little mosquitoes in the summer, that's how he is about human lives."

Speaking calmly, Breivik said he used a handgun to kill victims if the distance was less than 10 metres. Otherwise he used his rifle.

Asked why he spared one man who survived the shooting spree, Breivik said he thought it was because the man's appearance made him look "right wing-oriented."