A man was shot dead after armed police officers foiled an attempt to spring two would-be hitmen from a prison van as they made their way to court.
Four other men were arrested after the Scotland Yard operation targeted a car near Wood Green Crown Court in north London, where Izzet Eren, 32, and Erwin Amoyaw-Gyamfi, 29, were later both jailed for 14 years for an attempted "professional hit".
The man who was killed is believed to have been near the back entrance to the court building when he was fired on.
Scotland Yard said the operation was not related to terrorism, but would not confirm whether the man was shot by police.
There were four police officers inside the packed courtroom, with others stationed inside and outside the building as the two men were sentenced in a delayed hearing on Friday afternoon.
The court heard that Eren and Amoyaw-Gyamfi were arrested by armed police while riding a stolen motorbike in north London on October 13 and found to be carrying a Skorpion sub-machine gun and Tokarev handgun.
The court was told they were intercepted en route to "kill, or maim or wound" an unnamed person and pleaded guilty to charges of possessing guns and ammunition with intent to endanger life, aggravated vehicle-taking and a driving offence at a previous hearing.
They were both on licence for previous crimes when they were arrested, the court heard.
Jailing the men, who have a string of prior drug and violence convictions, Judge Nicholas Browne QC said the gravity of gun crime "could not be overstated".
The judge said: "This was to be a professional hit. Each of you was armed with a loaded, lethal weapon.
"The potential consequences were all too obvious. You could have been killed or seriously injured. So could innocent members of the public, not to mention your intended victim."
He added: "In sentencing you I completely ignore and put out of my mind the serious incident outside the court area, not far from where I am today. I observe and agree with your wish to be sentenced today."
Armed police wearing balaclavas and in unmarked 4x4 vehicles carried out the "intelligence-led" operation near the court at around 9am on Friday.
Scotland Yard said four men aged between 19 and 31 were arrested on suspicion of conspiracy to facilitate escape from lawful custody.
A 30-year-old and a 19-year-old were held by armed police in the Bracknell Close area, while a 31-year-old and a 25-year-old were detained in nearby Barratt Avenue. They are currently being questioned at separate police stations.
Witness Nick Lindsay, a workman who was surfacing a road nearby, said the man who was shot was sitting in his car when police moved in.
He told Sky News: "The police all came down, they all jumped out of cars with their guns and said 'Get down', and then there was a smash, then the gunshot went off. By that time police officers grabbed us to move us out of the way."
Mr Lindsay said the incident was over in 10 to 15 seconds, but the man had been in the car for around 30 minutes before the police swooped.
He said: "He was parked there for easily half an hour, I would have said, because he was there when we first turned up this morning. He must have been there at least half an hour, minimum."
An air ambulance was called to the scene, where police earlier cordoned off a section of road around the junction of Bracknell Close and Olympus Grove, near Winkfield Road.
Paramedics fought to save the man but he died before he could be taken to hospital.
A white forensics tent was erected near an ambulance in the residential street, which is lined on either side with cars, and plain clothes officers were seen with evidence bags.
The Directorate of Professional Standards - the Metropolitan Police's internal watchdog - is investigating, along with the Independent Police Complaints Commission (IPCC).