The state was fined €1,200 ($1,300) for making the non-smoking prisoner share a cell of around 20 square metres (215 square feet) with four to six fellow inmates, several of whom were smokers.
In the ruling handed down two weeks ago, judges said the plaintiff "was justified in arguing that... as a non-smoker his incarceration did not take place in the required hygienic conditions."
This was especially true as "the cells only have a small window," the court said.
The former prisoner -- about whom no more details were given -- also complained about "overcrowding in the cells he occupied and bad hygiene conditions, lighting and poor ventilation."
The court found that the conditions of the inmate's detention were a "breach of human dignity and revealed an error of a nature that puts the responsibility of public authorities on the line."
The plaintiff had initially asked for €6,050 in damages.