An internet troll who embarked on a "vile" cyber campaign against his brother-in-law after his arranged marriage failed 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 an Islamic State supporter, a paedophile and a would-be bomber in online attacks.

Islam created fake profiles on Twitter, Facebook and YouTube aimed at destroying the reputation of Mr Karim, of east London.

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, Mr Weekes said.

He created false Twitter and Facebook profiles using Mr Karim's name, or part of his name, on which Islam posted material "glorifying" terrorism.

Then 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, east London.

Islam went on to portray Mr Karim as a paedophile by creating a video and posting it using a fake social media profile on YouTube, the court heard.

The video entitled "Must watch child abuser, stay away from him" included an image of Mr Karim, the court heard.

Mr Weekes said: "The video suggested that he had been convicted in his 'home country' of child abuse in 2001, it suggested he targets children online, has been arrested several times in the UK because he abused so many children, and says he should be deported from UK. It also says that he lives in east London.

"Needless to say, the allegation is entirely untrue."

Mr Karim was alerted to the video by his uncle and he reported it to Plaistow Police Station.

Mr Weekes said: "Around the same time as this happening, the defendant's campaign against Mr Karim was to change tack slightly.

"It moved from the merely deeply nasty to the criminal. It sought to portray Mr Karim as a violent terrorist and a man who supported the aims of that most chilling of all terror groups, the Islamic State."

Later the same month, Islam created pseudo indecent images of children and sent them to Mr Karim's family.

The court heard he also created a profile on pornographic website X Videos in the name of Mr Karim and his wife and posted material on it.

When Islam was arrested at a Jobcentre in January 2016, a digital copy of the Anarchist Cookbook was found on his mobile phone and further evidence on his laptop, jurors were told.

The text of the book included instructions on how to make a viable bomb, which, Mr Weekes suggested, Islam may have planned to use as part of his ongoing campaign.

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

Naeem Mian QC said: "He will have to live with the label of being a terrorist - when he is not - and being a sexual deviant - when he is not.

"This is wholly unique, charged with terrorist offences but with no terrorist intent."

Mr Mian put Islam's behaviour down to his failure to earn the necessary £30,000 to bring his wife to Britain.

He said: "It's vile. It's absolutely vile. There's no getting away from that.

"Only now does he fully comprehend that which he has done. He recognises it is vile, inexcusable behaviour. He recognises the court will take an extremely dim view.

"He was profoundly stupid but he was blinded by that which he was seeking to achieve."

Judge Rebecca Poulet QC said: "Mercifully, it is certainly unusual conduct."

She 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.

Judge Poulet said Islam's now ex-wife had been "unhappy and afraid" of him at the time.

Jailing Islam, 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.