OSLO — Anders Behring Breivik, the Norwegian extremist who killed 77 people in a bomb and gun rampage in 2011, lives in conditions that would seem luxurious by American incarceration standards: a three-room suite with windows that includes a treadmill, a fridge, a television with DVD player and even a Sony PlayStation.

But on Wednesday, a Norwegian court found that the government had violated his human rights, concluding that his long-term solitary confinement posed a threat to his mental health. Mr. Breivik has virtually no contact with other inmates and is subjected to frequent strip searches and searches of his cell. At a trial in March, he argued that his isolation amounted to torture.

Judge Helen Andenaes Sekulic of the Oslo District Court, who oversaw the trial, which was held at the prison for security reasons, found on Wednesday that prison officials had violated an article of the European Convention of Human Rights that prohibits “inhuman or degrading treatment or punishment.” She directed the government to reduce the extent of Mr. Breivik’s isolation — though she did not specify how — and ordered the government to pay Mr. Breivik’s legal fees of 331,000 kroner, or about $40,600.

However, she dismissed a related complaint that the prison officials had also violated the convention’s guarantee of respect for private and family life, and rejected Mr. Breivik’s demand for fewer restrictions on receiving visitors and sending and receiving phone calls and letters. The government has said that it restricts and censors his communications to prevent him from encouraging violent extremism.