An internet troll who posed as his brother-in-law online so that anti-terror police would believe he was an Islamic State (IS) supporter has been jailed for more than five years.

Shohidul Islam, 26, was said by the prosecution to have launched a "vicious digital and online campaign" against Mohammed Razaul Karim after becoming bitter over the breakup of his marriage to his victim's sister.

He created fake social media accounts under Karim's name and wrote messages supporting the terror group IS.

His hate campaign even saw him make a hoax bomb threat at a primary school and frame his brother-in-law as a paedophile.

Islam, of Bradford, West Yorkshire, pleaded guilty to terror and child pornography offences on the fourth day of his trial at the Old Bailey. He was sentenced to five years and eight months imprisonment on Friday (27 October).

Judge Rebecca Poulet QC said east Londoner Karim was the victim of a "wicked campaign" and could have faced "dire consequences" had he come to the attention of authorities.

The court heard how unemployed Islam targeted Karim after his marriage "fell to pieces" because he couldn't afford to bring his wife and son over to the UK from Bangladesh.

Karim first contacted police in December 2015 after a YouTube video emerged online containing false allegations that he had been convicted of child sex offences abroad.

At the time there was no indication as to who was behind the video and account.

But the following month an email purporting to be from his uncle was sent to detectives alleging that Karim was also manufacturing a homemade bomb and that he was planning to target Kier Hardy Primary School in Canning Town, east London.

Police soon found the threat to be a hoax and Islam was arrested at his local job centre around two weeks later.

An investigation revealed Islam was not only behind the fake bomb threat but had created social media accounts on Twitter and Facebook in the name of his brother-in-law.

Posing as Karim, he had posted messages showing support for IS and praised previous terrorist attacks in the UK.

He also posted what he claimed were details of members of the British armed forces – including names and addresses – in the hope they would be seen as an attempt to encourage others to commit terrorist attacks against them.

Furthermore, mobile phone and computer equipment belonging to Islam proved he had photoshopped images of children onto pornographic photos in order to discredit his brother-in-law as a paedophile.

Islam was also found in possession of The Anarchist Cookbook, a bomb-making guide which is banned under anti-terror legislation.

While initially denying the charges against him, Islam subsequently pleaded guilty to two counts of reckless encouragement of terrorism, possession of material useful to a terrorist, making a bomb hoax and making indecent images.

Commander Dean Haydon, Head of the Met's Counter Terrorism Command, said: "Islam's actions throughout this whole affair were extremely reckless and utterly despicable.

"With the current threat level as it is, my officers are busy enough dealing with those who pose a genuine threat, without having to deal with hoax bomb threats and somebody trying to settle a family feud in this way.

"The case against him was so compelling that in the end, Islam was left with little choice other than to plead guilty.

"His actions would have undoubtedly had a great impact on his brother-in-law, who was his intended victim in all of this. I only hope that today's outcome brings some small comfort to him so that he can begin to put this behind him."