Islamist extremists planned a bomb and gun attack on an English Defence League rally in the knowledge that it would spark a tit-for-tat spiral of violence, a court heard.

The plot to bomb the rally in Dewsbury, West Yorkshire, in June last year failed only because of a mixture of incompetence and chance after the plotters turned up late. One of their cars was then impounded following a traffic check on their way home.

The bungling group had planned the attack for eight weeks, including research to find the telephone number of the EDL’s leader Tommy Robinson and tracking the location of EDL rallies. The Old Bailey heard that it had planned “terrible vengeance” on the EDL for what it saw as blasphemous words and actions against Islam.

Download the new Independent Premium app Sharing the full story, not just the headlines

Mr Robinson briefly watched proceedings from the public gallery of the Old Bailey. Outside, police stepped up security as dozens of EDL members gathered at a pub close to the court. One man was held on suspicion of being drunk and disorderly.

The six men being sentenced, all from the West Midlands, admitted planning the attack in April 2012. Jewel Uddin, 27, Omar Mohammed Khan, 31, Mohammed Hasseen, 24, Anzal Hussain, 25, Mohammed Saud, 23, and Zohaib Ahmed, 22, will learn their sentences today.

All of the men except Hasseen travelled to Dewsbury on the day of the rally but arrived at around 4pm, while the event had finished earlier than expected, at 2pm. They were armed with two shotguns, swords, knives, a nail bomb containing 458 pieces of shrapnel, and a partially assembled pipe bomb.

Bobbie Cheema QC, prosecuting, told the court: “They intended to bring about a violent confrontation with the EDL during which they intended to use weapons to cause serious injuries and they anticipated, each one of them, that some victims may have died.”

She added: “Had the retaliatory attack gone ahead as planned, it would have had a powerful impact on relations between different groups who, for the most part, live peacefully alongside each other in the UK, and that impact would probably have still been reverberating today.”

Sentencing continues today.