A British High Court judge sought guidance from a 19th Century English philosopher as he tried to decide whether a doctor could lawfully refuse to administer a blood transfusion to a mentally-ill sex offender who has adopted the Jehovah's Witness faith.

Mr Justice Mostyn, who concluded that a doctor could lawfully decide not to administer a transfusion under the terms of mental health legislation, told lawyers at a hearing in the Court of Protection that he had recently been reading the work John Stuart Mill.

He made three references to Mill's thinking in a ruling on the case.

The judge analysed the issues at a hearing in London in April after officials at the health authority with responsibility for man's care asked for a ruling by the Court of Protection, which is part of the High Court and handles cases relating to vulnerable and sick people.

He made a decision at the end of the hearing and has now outlined his thinking in a detailed written ruling.

Doctors said the man, who had been convicted of a sex assault and given a jail term, had a long history of "significant and repeated self-harming behaviour".

The judge was told that he had been moved to hospital from prison after cutting his arm with a razor blade and opening an artery.

Specialists said he had suffered significant blood loss and his haemoglobin had fallen to "an extremely life-threatening level".

They had advised a blood transfusion but the man, who had a "severe personality disorder", refused blood products on the basis of his faith.

Mr Justice Mostyn first referred to Mill's thinking as he considered legal principles underlying the case.

"In principle, every citizen who is of age and of sound mind has the right to harm or [since 1961] to kill himself," said the judge in his ruling.

"This is an expression of the principle of the purpose of power found in the Declaration Of The Rights Of Man And Of The Citizen (1793) and in John Stuart Mill's essay On Liberty (1859) where he stated 'that the only purpose for which power can be rightfully exercised over any member of a civilised community, against his will, is to prevent harm to others. His own good, either physical or moral, is not a sufficient warrant ... Over himself, over his body and mind, the individual is sovereign'."

The judge again turned to Mill when considering the consequences "self-destruction" might have on others and added: "As Mill says, 'I fully admit that the mischief which a person does to himself may seriously affect, both through their sympathies and their interests, those nearly connected with him, and in a minor degree, society at large'."

And he made another reference to Mill when considering how a Jehovah's Witness would be affected if forced to have a blood transfusion.

"This aspect of the test of capacity must be applied very cautiously and carefully when religious beliefs are in play," said Mr Justice Mostyn.

"In his essay John Stuart Mill speaks of the prohibition in Islam on the eating of pork. He describes how Muslims regard the practice with 'unaffected disgust'; it is 'an instinctive antipathy'.

"There can be no circumstances where a Muslim could 'weigh' the merit of eating pork. It is simply beyond the pale. So too, it would appear, when it comes to Jehovah's Witnesses and blood transfusions."

Lawyers for the health authority said a specialist treating the man had taken the view that a blood transfusion should not be administered against his wishes.

Mr Justice Mostyn said that was a legitimate decision.

Health authority lawyers said a court ruling had been sought because the doctor - a representative of the "state" - was making a decision which could lead to the man's death.

And Mr Justice Mostyn said it was right that the issue had been scrutinised in court.

The hearing was held in public.

Mr Justice Mostyn said the health authority involved - Nottinghamshire Healthcare NHS Trust - could be named.

But the judge said nothing could be reported which would identify the man or his location.

Jehovah's Witnesses say they refuse blood on the basis of Biblical teaching.

The official website of Jehovah's Witnesses says the Old and New Testaments "clearly command us to abstain from blood".

The site says they avoid taking blood in obedience to God and "out of respect for him as the giver of life".