Judge Nicholas Hilliard QC told the men: "How was it that you became involved in a crime of this gravity? At least part of the answer to that question must come in the tide of apparently freely available extremist material in which most of you had immersed yourselves."

Jewel Uddin, 27, Omar Mohammed Khan, 31, Mohammed Hasseen, 24, Anzal Hussain, 25, Mohammed Saud, 23, and Zohaib Ahmed, 22, who are all from the West Midlands, admitted planning the attack at a hearing on April 30.

Khan, Uddin and Ahmed were jailed for 19-and-a-half years with an extended licence period of five years, and the other three were given jail terms of 18 years and nine months and an extended licence period of five years.

Robinson and his deputy Kevin Carroll called out "God save the Queen" from the public gallery as sentence was passed.

The judge said the extremist material was "not difficult either to obtain or share".

He said: "In this case, it can only have served to reinforce the defendants' resolve to behave in the hideous way that was planned".

All the men will serve at least two-thirds of the jail terms before they can be considered for parole.

They were imprisoned today on the third day of the sentencing process.

All of the men except Hasseen travelled to Dewsbury where an EDL rally was taking place on June 30 last year, ready to cause mass injuries and deaths.

The gang's plan only failed because the event finished earlier than expected - they arrived at around 4pm when it was over shortly after 2pm.

Judge Hilliard said: "There is no reason to suppose that a further attempt may not have been made in the future had the defendants not been apprehended. I find it inconceivable that your resolve would have evaporated."

He went on:" You intended to engage in a violent confrontation with those attending the EDL rally and use the weapons and the IED (improvised explosive device) to cause serious injuries, and you anticipated that some victims may have died."

As well as targeting EDL supporters, police officers and members of the public could have been caught up in the bloodshed, the court heard.

The judge said that had the attack succeeded it could have sparked "a spiral of tit-for-tat violence".

He said: "That is a particularly serious aspect of this case. That simply cannot be an aspect of life in a society where the overwhelming majority choose to live in harmony with their fellow men and women."