Five defendants at a Moscow courthouse attacked their guards in a bungled escape attempt, leading to a shootout that killed three people and wounded four others, officials have said.
The incident happened when five handcuffed defendants were escorted by two guards in a lift at the Moscow Regional Court, Russia's Investigative Committee said.
One of the defendants tried to strangle a guard, Russia's chief investigative body said.
The defendants somehow managed to escape and seized the guards' weapons.
Three of the defendants were killed and two wounded in a shootout with the court's guards.
Two guards were injured and taken to hospital, the agency said.
The incident took place before a hearing for a gang of nine who are suspected of killing more than a dozen motorists, authorities said.
Russian media dubbed the accused "the Grand Theft Auto gang", after the violent video game.
The men on trial are accused of terrorising Moscow motorists for months in 2014.
Prosecutors said the gang members were placing spikes on roads, forcing the motorists out of their vehicles and shooting them dead.
The nine men, all from Central Asia, are charged with 17 murders and two attempted murders.