At least three defendants on trial for 17 gang murders were killed in a shootout at a regional court in Moscow on Tuesday after they tried to seize their guards' weapons and flee, officials said.

Five defendants were in a lift in the Moscow regional court building when they tried to seize the weapons from the officers escorting them, Tatyana Petrova, a spokeswoman for Moscow region police, told Russian state television.

She said three of the defendants were shot as they tried to escape, and two others were wounded.

Three law enforcement officials were also wounded, said Petrova and Yevgeny Kubyshkin, a spokesman for the Russian National Guard, which had an officer in the court.

A lawyer at the court, Sofya Rubasskaya, told AFP: "I heard shots. There were more than 20 shots." She said she saw a wounded female guard whose "face was all bloody".

After the shootout, everyone in the court was evacuated and all hearings have been postponed, the lawyer said.

Speaking from Moscow, Al Jazeera's Rory Challands said that the three defendants were members of a gang that were involved in "one of the more lurid episodes of Moscow's recent past".

"In the summer of 2014, there was a spate of rather strange murders on the lonely highways outside of Moscow," he said.

In the dead of night, the gang members placed metal spikes on roads to burst the tyres of passing cars, then ruthlessly shot their drivers and disappeared.

Challands said that there were no obvious motives for the murders.

"Because the court case and most of the court's proceedings were closed to the media, there's a lot we still don't know about what this gang was and what their motives were," he said.

The group was dubbed in the Russian press as the GTA Gang, a reference to the Grand Theft Auto violent series of video games.

The investigation into the gang charged a total of nine defendants, all of whom originated from ex-Soviet Central Asian states, with murder, "banditry", robbery and arms trafficking.

The gang's suspected leader was killed during an attempt to capture him.