A man has been jailed for 12 weeks after admitting making grossly offensive comments on his Facebook page about missing 5-year-old April Jones.
Matthew Woods, 19, from Chorley, Lancashire, made a number of derogatory posts about April and Madeline McCann after getting the idea from Sickipedia - a website that "trades in sick jokes".
He also wrote comments of a sexually explicit nature about the five-year-old who went missing last week from near her home in Machynlleth, mid Wales.
Chorley Magistrates' Court heard members of the public were so upset about his postings that they reported them to the police.
A "vigilante mob" of around 50 people later descended upon his home address in Eaves Lane and the defendant was arrested on Saturday night at a separate address for his own safety.
Chairman of the Bench Bill Hudson said: "We have listened to the evidence in what can only be described as a disgusting and despicable crime and the bench finds was completely abhorrent.
"The words and references used to the current case in Wales and that of the missing girl in Portugal are nothing less than shocking, so much so that no right thinking person in society should have communicated to them such fear and distress."
He added that families involved in cases such as these should not have to be subjected to any use of social media like this and should not be used to mistreat people in this way.
He said only a custodial term in a young offender institute was appropriate, which was greeted by applause from around 30 people sitting in the public gallery.
Mr Hudson concluded: "The reason for the sentence is the seriousness of the offence, the public outrage that has been caused and we felt there was no other sentence this court could have passed which conveys to you the abhorrence that many in society feel this crime should receive."
Martina Jay, prosecuting, said: "When interviewed by police he fully admitted he posted messages about the two missing children.
"He started this idea when he was at a friend's house when drinking, saw a joke on Sickipedia and changed it slightly.
"He said he did it in a bid to make people think his account had been hacked. He said it got out of hand and he was drunk while doing it."
He conceded to police that his Facebook account - available to a large number of people - had not been hacked and that he was responsible for all the postings made on October 3 and 4.
Unemployed Woods entered a guilty plea to sending by means of a public electronic communications network a message or other matter that is grossly offensive.
After meeting his client for the first time, defending solicitor David Edwards told the bench: "What struck me immediately is that the enormity of what he has done has finally sunk in.
"He did seem guinenely remorseful and regretful for what he had done.
"At the time he posted these comments not once did he think he would find himself where he is today."
He said Woods got the idea for the posting from Sickipedia "which basically trades in sick jokes".
Mr Edwards added: "He started receiving derogatory replies almost immediately and then came threats.
"The reality is that before long a number of people realised what he had done and sought him out."
The solicitor said Woods explained what had started as a joke had gone wrong.
"He realises this will have a profound effect on him," he continued. "With the publicity that has followed he will be known as the man who made these comments on Facebook.
"He has to live with this because of his stupidity.
"His future is uncertain. He does not know whether he can go back to his home address.
"He fully accepts he was the author of his own misfortune.
"Nothing like this is going to happen again. He appreciates what he has done and puts himself at the mercy of the court."
Woods will spend his sentence in a young offenders institute.