An internet troll who falsely portrayed his brother-in-law as a Islamic State supporter, paedophile and would-be bomber of a Canning Town primary school has been jailed for five and a half years.

Jobless Shohidul Islam, 26, “fell to pieces” because he was unable to earn enough money to bring his wife and son to Bradford from Bangladesh.

Nursing feelings of “deep-seated inadequacy”, Islam falsely branded Mohammed Razaul Karim, who lives in east London, as an Islamic State supporter, a paedophile and a would-be bomber in online attacks.

Midway through his Old Bailey trial, Islam admitted two counts of encouragement of terrorism, making a bomb hoax at a primary school, making indecent photos of children and possessing the Anarchist Cookbook.

Earlier this week, prosecutor Mark Weekes told jurors that charges arose from a “vicious digital and online campaign” against Mr Karim between late 2015 and early 2016.

Islam had married Mr Karim’s sister Fahmida Parveen Shuba in 2010, but she stayed in Bangladesh, and by 2016 their relationship was over.

Islam’s activities ranged from the “deeply nasty to the criminal”, and included portraying his target as a supporter of Islamic State on false Twitter and Facebook profiles, Mr Weekes said.

In January 2016, the defendant, posing as Mr Karim’s uncle, filed a false report his victim was planning to detonate a “microwave bomb” at a primary school in Canning Town.

Former call centre worker Islam, who lived with relatives in Hillcote Drive, Bradford, was described by his lawyer as mentally “fragile”.

Judge Rebecca Poulet QC said Mr Karim, the target of the “wicked campaign”, was completely innocent but could have faced “dire consequences” had he come to the attention of authorities.

She added Islam’s now ex-wife had been “unhappy and afraid” of him at the time.

Jailing Islam today, she said: “These five serious offences were, in my judgment, in part chosen by you to cause your wife’s brother acute distress, embarrassment and fear and actually placed him at great risk of criminal prosecution.

“In your campaign against him you yourself committed these very offences.

“Mr Karim has been left scared, upset and hurt.”

Islam was also handed a restraining order against further contact with Mr Karim and his family.