STAVANGER, Norway — Norwegian authorities have violated the human rights of killer Anders Behring Breivik by holding him in solitary confinement in a three-cell complex where he can play video games, watch TV and exercise, a court in Oslo ruled Wednesday.

The district court said the isolation that Breivik faces in prison for killing 77 people in 2011 is in breach of the European Convention on Human Rights.

The court ordered the government to pay Breivik's legal costs of $41,000. But it dismissed Breivik's claim that his right to respect for private and family life was violated by restrictions on contacts with other right-wing extremists.

Breivik, 37, had sued the government, saying his isolation from other prisoners, strip searches and the fact that he was often handcuffed during the early part of his incarceration violated his rights. During a four-day hearing last month at Skien prison in southern Norway, where he is serving his sentence, he also complained about the quality of the prison food, having to eat with plastic utensils and not being able to communicate with sympathizers.

The government rejected his complaints, saying he was treated humanely despite the severity of his crimes and that he must be separated from other inmates for safety reasons.

“We are surprised,” a government attorney said after the verdict.

He said his team would study the verdict before deciding whether to appeal.

Breivik has been held in isolation since the July 22, 2011, attacks.

Breivik set off a car bomb in 2011 outside the government headquarters in Oslo, killing eight people and wounding dozens. He then drove to Utoya, where he opened fire on the annual summer camp of the left-wing Labor Party's youth wing.