Norwegian right-wing extremist Anders Behring Breivik's human rights have been violated during his imprisonment for terrorism and mass murder, a court ruled Wednesday.

In a written decision, the Oslo district court said Breivik's prison conditions after he killed 77 people in 2011 attacks breached an article in the European Convention on Human Rights prohibiting inhuman and degrading treatment.

The ruling specifically cited Breivik's isolation in two different prisons since his arrest on July 22, 2011. It also said authorities hadn't given enough attention to his mental health when determining his conditions in prison.

The court dismissed Breivik's claim that the government had also violated his right to respect for private and family life. It ordered the government to pay Breivik's legal costs of 331,000 kroner — about $41,000.

"The prohibition of inhuman and degrading treatment represents a fundamental value in a democratic society," the court said. "This applies no matter what — also in the treatment of terrorists and killers."

Breivik sued the government, saying his isolation from other prisoners, frequent strip searches and the fact that he was often handcuffed while moving between the three cells at his disposal violated his human rights. During a four-day hearing at the Skien prison where he is serving his sentence, he also complained about the quality of the prison food and about having to eat with plastic utensils.

The government rejected his complaints, saying he was treated humanely despite the severity of his crimes.

Breivik's attacks shocked Norway on July 22, 2011. After months of meticulous preparations, he set off a car bomb outside the government headquarters in Oslo, killing eight people and wounding dozens.

He then drove to Utoya island, where he opened fire on the annual summer camp of the left-wing Labor Party's youth wing. Sixty-nine people were killed, most of them teenagers, before Breivik surrendered to police.