A judge has intervened to prevent a man from sharing naked images of himself online, after ruling that he does not understand what he is doing.

The 21-year-old, who has learning difficulties, now cannot access the internet and social media unless under strict supervision. The unprecedented case is the first case to assess a person’s capacity to use the internet.

The “vulnerable” man, who cannot be identified and who is referred to only as ‘A’, is the subject of a Court of Protection ruling which came after it emerged that he had shared explicit pictures of himself, searched for child pornography and communicated with men implicated in one of the nation’s biggest child sex grooming operations.

In his ruling earlier this year, Mr Justice Cobb found that A did not understand whether he was searching for illegal, extreme and sexual content online.

He said: “When unsupervised A is known to search compulsively for pornography and he has, worryingly, developed a considerable interest in sites showing paedophiliac and extreme, even illegal, sexual activity; he cannot read nor understand the warnings regarding content and safety.”

A’s case marked the first time that the court assessed how to assess whether someone has the capacity to use the internet and social media and know what they are doing.