Norwegian mass murderer Anders Behring Breivik has won part of a human rights case against the Norwegian state.
The court upheld his claim that some of his treatment amounted to "inhuman or degrading treatment or punishment".
After the judgement, Breivik's lawyer, Oystein Storrvik, called for his solitary confinement to be repealed.
Breivik, a right-wing extremist, killed 69 people at a summer camp for young centre-left political activists on the island of Utoeya in July 2011.
Earlier that day, he set off a car bomb in the capital, Oslo, killing eight people.
In her ruling, judge Helen Andenaes Sekulic said the right not to be subjected to inhuman treatment represented "a fundamental value in a democratic society" and also applied to "terrorists and killers".
Breivik had challenged the government over his solitary confinement, which saw him kept alone in his cell for 22 to 23 hours a day, denied contact with other inmates and only communicating with prison staff through a thick glass barrier.
His prison regime deviated so markedly from that enforced upon any other prisoner in Norway, regardless of the severity of their crimes, that it had to be considered an extra punishment, the judge said.
However, article three of the European Convention on Human Rights (ECHR) required that prisoners be detained in conditions that did not exceed the unavoidable level of suffering inherent in detention, given the practical requirements of the particular case, she said.
The prison authorities had also not done enough to counteract the damage he had suffered from being in isolation, she said.
Judge Sekulic also noted that Breivik had been woken up every half hour at night over a long period of time and on some occasions subjected to strip searches with female officers present, which he found particularly difficult.
"Taken together with the other stringent restrictions which he was subject, this was regarded as degrading treatment in the Convention sense," said the judge, Norwegian national broadcaster NRK reported.
'Facilitate a community'
State lawyer Marius Emberland said the government was surprised by the verdict but had not decided whether to appeal.
If neither side appeals within four weeks, the prison is obliged to make Breivik's regime more lenient in line with the judge's remarks, NRK reported.
The prison must work to bring in other prisoners and "facilitate a community", the judge said.
However, the judge ruled that strict controls on Breivik's correspondence were justified and his right to a private and family life under article eight of the ECHR had not been violated.
The court also ordered the Norwegian state to pay Breivik's legal costs of 330,000 kroner ($40,000; £28,000).
Eskil Pedersen, a survivor of the shootings on Utoeya island, said he was "surprised, and then angry and upset" by the ruling.
"It was like being punched in the gut that the perpetrator won such a public victory," he told NRK.
Another survivor, Bjorn Ihler, tweeted that the judgement in Breivik's favour showed Norway had a "working court system, respecting human rights even under extreme conditions".
Lisbeth Kristine Roeyneland, who runs a support group for the victims' families, told NRK she was surprised and "a little disappointed", but also relieved that the ruling prevented him making contact with other extremists.