Medics can restrain a middle-aged man with a severe learning difficulty in order to prepare him for surgery in the UK, a judge in a specialist court has ruled.
A care manager said the man became distressed at hospitals and refused to drink.
She told Mr Justice Moor that administering a sedative in a liquid would be very difficult and probably not worth trying.
The judge concluded that allowing medics to briefly restrain the man and inject a sedative would be a more humane option.
He said medics should use minimum force and do all they could to preserve the man's dignity.
Mr Justice Moor made the ruling on Friday after analysing evidence at a hearing in the Court of Protection, where issues relating to people who lack the mental capacity to take treatment decisions are considered, in London.
Specialists said the man needed bladder surgery.
They told the judge that an operation should improve and lengthen the man's life.
Mr Justice Moor said the man could not be identified.
Barristers Conrad Hallin had represented hospital bosses who wanted the judge to approve treatment plans.
The man had been represented by staff from the Official Solicitor's office, which provides help to vulnerable people involved in court cases.
Barrister Parishil Patel had asked questions on the man's behalf.