Six men and two youths have gone on trial after "at least 12 shots" were fired at police officers during last summer's riots in Birmingham.
Wayne Collins from Luton, Tyrone Laidley, Francis Nicholas, Renardo Farrell, Jermaine Lewis, all from the West Midlands, Joyah Campbell of no fixed address and two teenagers who cannot be named, all deny riot, violent disorder, possession of a firearm with intent to endanger life and reckless arson.
Prosecuting, Andrew Lockhart QC, told the jury that this case was not about "large scale looting" but the aim of the defendants, he said, was to "lure" a "large number of police officers onto the streets where they could be attacked".
Birmingham Crown Court heard that on the night of Tuesday, August 9, 2011, a group of 30 people, their faces covered, with some carrying "lit petrol bombs", broke into the Barton Arms pub in Newtown, Birmingham.
A fire was started while the occupants were upstairs "at huge risk to their lives".
The group threw furniture out of the windows and attempted to car-jack a taxi driver nearby.
Another large group arrived and "cheers" are heard on mobile phone footage as the two groups join together. The prosecution allege that this shows the incident was "organised".
Large numbers of police riot vans arrived and that, said Mr Lockhart, is "exactly what had been anticipated".
He said before the group dispersed "at least 12 shots were fired at police" and "at least four firearms" were "carried and used that night".
The opening of the case is due to continue and the trial is likely to last six weeks.