High Court judges have ruled psychiatric patients should not be allowed to smoke at a high security mental hospital.
The patients should not endanger their own and others' health by smoking at Rampton hospital in Nottinghamshire, the judges ruled.
Three patients had argued a ban on them smoking "in the privacy of their own home" violated their human rights.
But the judges ruled any interference with their rights was justified.
Lord Justice Pill said: "There is very strong evidence that smoking causes disease and endangers the health of the smokers themselves and other people who live and work in their vicinity.
"There is, in our view, powerful evidence that, in the interests of public health, strict limitations upon smoking, and a complete ban in appropriate circumstances, are justified."
The judge added the smoking ban was also justified by security difficulties posed by allowing inmates - many of whom have "dangerous, violent or criminal propensities" - to smoke outside in Rampton's grounds.
"Rampton is operated as a hospital by National Health Service staff and distinction between it and prisons and other accommodation is justified," he said.
"Like other hospitals, it is smoke-free. Both health and security considerations justify the ban even though smoking in the grounds, which may be possible at other hospitals, is not feasible at Rampton," Lord Justice Pill said in a decision made along with Mr Justice Silber.
A Ministry of Justice spokeswoman said prisoners were able to smoke in their cells, but not in common areas, and prisoners were encouraged to quit or reduce smoking.
Neil Rafferty of the pro-smoking group Forest said: "I think it is cruel to impose what is a petty bureaucratic decision in this way. The hospital should be able to provide a facility for these people to have a cigarette."
Lawyers for the patients had argued the smoking ban meant they would be the only group of people in the country banned from smoking "in the privacy of their own home".
Laura Pinkney of solicitors Cartwright King, said she was "very disappointed" and the patients may decide to appeal directly to the Court of Appeal.
The patients had also challenged the legality of a decision by Nottinghamshire Healthcare NHS Trust, which manages Rampton, to impose the ban from April last year.
The three patients who brought the case, all of them legally-aided, were denied permission to appeal against the High Court's ruling.
The court imposed an order banning the identification of the three patients.