LONDON (Reuters) - Anjem Choudary, Britain’s best-known Islamist preacher, was jailed on Tuesday for five years and six months for encouraging support for Islamic State, ending years of frustration for police who had struggled to pin charges on him.

Anjem Choudary, the leader of the dissolved militant group al-Muhajiroun, arrives at Bow Street Magistrates Court in London July 4, 2006. REUTERS/Stephen Hird/Files

Choudary, 49, and close associate Mizanur Rahman, 33, who received the same sentence, had been convicted by a jury in July of using the Internet to urge followers to back the banned group, which controls large areas of Syria and Iraq.

“These men have stayed just within the law for many years and there has been frustration for both law enforcement agencies and communities as they spread hate,” said Dean Haydon, head of counter-terrorism at London’s Metropolitan Police.

“We have watched Choudary developing a media career as spokesman for the extremists, saying the most distasteful of comments, but without crossing the criminal threshold,” Haydon said in a statement.

Long denounced by the press in Britain as a hate preacher, Choudary is also well-known abroad, making regular TV appearances in the wake of attacks by Islamist militants to blame Western foreign policy for targeting Muslims.

His trial heard that in postings on social media, Choudary and Rahman had pledged allegiance to the “caliphate” declared by Abu Bakr al-Baghdadi and said Muslims had a duty to obey or provide support to him.

“Their recent speeches and the oath of allegiance were a turning point for the police - at last we had the evidence that they had stepped over the line and we could prove they were actively encouraging support of ISIS,” said Haydon.

Both men had denied the terrorism charges and said the case against them was politically motivated. They were convicted after a four-week trial at London’s Old Bailey criminal court, where they were sentenced by a judge on Tuesday.

Choudary, the former head of the now banned organization al-Muhajiroun, first drew widespread attention for praising the men behind the 9/11 attacks on the United States and for saying he wanted to convert Buckingham Palace, Queen Elizabeth’s official London residence, into a mosque.

Slideshow ( 3 images )

OATH OF ALLEGIANCE

Despite such comments and his refusal to condemn attacks by Islamists, including bombings of the London transport system in 2005, Choudary has always denied any involvement in militant activity and had never been previously charged with any terrorism offense.

Rahman had previously served two years in jail for encouraging followers during a protest in 2006 to kill British and U.S. troops in Afghanistan and Iraq.

Evidence presented during the trial included speeches posted online in which Choudary spelt out his arguments for recognizing Al-Baghdadi as the leader of Islamic State.

The court had also heard that Choudary and Rahman had pledged allegiance to the group and used Mohammed Fachry, a convicted terrorist, to publish the oath on an Indonesian website.

“The jury were sure that you knowingly crossed the line between the legitimate expression of your own views and the criminal act of inviting support for an organization which was at the time engaged in appalling acts of terrorism,” said the judge, Timothy Holroyde.

“You are both mature men and intelligent men who knew throughout exactly what you were doing.”

Al-Muhajiroun, a banned group whose name in Arabic means ‘The Emigrants’, has been viewed as a breeding ground for militants since it was founded in the late 1990s by Syrian-born Islamist cleric Omar Bakri. He was banished from Britain in 2005.

Police said the group was suspected of being the driving force behind the 2005 London bombings, while Michael Adebolajo, one of the men who hacked to death British soldier Lee Rigby on a London street in 2013, had attended protests organized by Choudary.

The group’s influence is believed to extend far beyond Britain. Those connected to it include Abu Hamza al-Masri, who was jailed for life in the United States last year for terrorism-related offences.