MOSCOW -- In a desperate attempt to escape, five defendants charged with multiple murders grabbed weapons from their escorts Tuesday at a Moscow courthouse, sparking a shootout with other guards in the building's corridors. Three of the assailants were killed and the two others were wounded and recaptured, officials said.

Russia's Investigative Committee said the attempted getaway began while the five handcuffed men were being escorted by two guards -- one male, one female -- in an elevator at the Moscow Regional Court.

The defendants attacked the escorts and disarmed them, but one of the guards managed to push an alarm button.

Get Breaking News Delivered to Your Inbox

The court's spokeswoman, Natalya Osipova, said the assailants took the two guards hostage but were quickly engaged by the courthouse's security. She said the other four defendants facing charges in the same criminal case were in a separate room when the incident happened.

Three of the defendants were killed and the other two were wounded in the ensuing shootout with the court's guards. Russian state television showed the footage of the blooded bodies spread in a courthouse corridor.

A Russian national guard officer speaks on his mobile phone outside the Moscow regional court building, where three people being taken to trial for robbery and murder were shot dead after they grabbed side-arms from court security officers in an attempt to escape, outside Moscow, Russia, August 1, 2017. Valentyn Ogirenko/Reuters

A guard wounded in the gunbattle was rushed to a hospital, and the two guards assaulted in the elevator were also hospitalized with injuries, the committee said.

One of them, her face swollen and badly bruised, described the attack to NTV television from her hospital bed.

"They beat me with their fists. And the weapons, they captured," she said, speaking with difficulty.

Prosecutors are investigating to see if the procedure for escorting murder defendants was properly observed.

The defendants, all from ex-Soviet Central Asia, were accused of killing 17 motorists near Moscow in a series of attacks in 2012-2014.

Police officers walk towards to the main entrance of Moscow Regional Court is seen in Moscow, Russia, Tuesday, Aug. 1, 2017. Andrey Nikerichev/Moscow News Agency via AP

Russia media dubbed the accused "the Grand Theft Auto gang" after the violent video game. Prosecutors said the gang numbered 14 men who were placing spikes on roads, forcing the motorists out of their vehicles and shooting them dead.

The Reuters news agency writes that one member of the group had fought for the Islamic State of Iraq and Syria (ISIS) before coming to Russia, according to local media who cites a law enforcement source.

The brutal killings terrorized Moscow motorists for nearly two years. Police launched a massive effort to apprehend the gang and eventually managed to track them down thanks to a gun found at the site of one of the attacks and other evidence.

The suspected ringleader, a native of Uzbekistan, was killed in a gunbattle with the police who came to arrest him in 2014. His brother was among the defendants killed in Tuesday's gunbattle.

Nine suspected members of the gang have been on trial since last summer, and prosecutors have asked for life sentences. Another four are still at large.