A judge is set to decide whether a man with mental health difficulties who admits having fantasies involving sexual violence and children can visit a prostitute.
Council social services bosses have asked Mr Justice Hayden to consider the case and decide whether the man has the mental capacity to make decisions about having contact with prostitutes.
The judge began analysing evidence at a hearing in the Court of Protection, where issues relating to people who lack the mental capacity to make decisions are considered, in London on Wednesday.
He is expected to deliver a ruling, after a trial, in the new year.
READ MORE: Convicted robber and burglar abscond from HMP Kirkham
Mr Justice Hayden said the man, who is in his 20s, could not be identified in media reports of the case.
He said Lancashire County Council had responsibilities for the man's care and had begun litigation.
The judge heard from lawyers representing Lancashire council, the man, and health authority bosses.
He was told that the man currently lived in supported accommodation and had a "carefully designed" care package.
That care plan was designed to keep the man away from areas where children might be.
The judge said the man had described "sex fantasies" which were "alarming".
Lawyers said the man had no criminal record but had, at one stage, been detained in a specialist hospital under the terms of mental health legislation.
Mr Justice Hayden said the man had come to the conclusion that his prospects of "getting a girlfriend" in "conventional ways" were "very limited" and had asked carers if he could visit a prostitute.
The judge was told that issues relating to the danger the man might pose to a prostitute would have to be considered.
Lawyers said the judge would also have to consider whether carers would be at risk of prosecution if they took the man to see a prostitute.
They said the man would pay for any prostitute himself.