A district court on Wednesday ordered the government to pay ¥400,000 in damages to an inmate who was unjustifiably held for months in solitary confinement in a cell equipped with a surveillance camera.

The Kumamoto District Court ruled it was unlawful to continue holding the 35-year-old man in solitary confinement with a camera even after it became unnecessary to monitor him.

While the use of a camera is permitted in solitary cells, it is clear that being held in a cell equipped with one is "mentally tougher," and the man was held there for an unreasonable amount of time, the court added.

According to the complaint, before he was held in solitary confinement, the inmate was held in a protection room from the end of January to early February 2012 after he kicked a door. Such cells are used to hold inmates who could injure others and aren't equipped with surveillance cameras.

The Kumamoto prison later placed him in solitary confinement in a room equipped with a surveillance camera for hitting an officer in the face. That stint lasted seven months, through October 2013.

The inmate argued that it was unlawful to use a cell with a surveillance camera without specific regulations.

The court said the use of surveillance cameras should generally be limited to less than 72 hours.

The government argued that the man had been treated appropriately due to his repeated "violent behavior."