TRIPOLI (Reuters) - A Libyan court on Tuesday sentenced Muammar Gaddafi’s most prominent son, Saif al-Islam, and eight others to death over war crimes including killings of protesters during the 2011 revolution that ended his father’s rule.

Saif al-Islam Gaddafi, son of late Libyan leader Muammar Gaddafi, attends a hearing behind bars in a courtroom in Zintan May 25, 2014. REUTERS/Stringer

The former Gaddafi regime officials sentenced to die by firing squad included former intelligence chief Abdullah al-Senussi and ex-prime minister Baghdadi al-Mahmoudi, Sadiq al-Sur, chief investigator at the Tripoli state prosecutor’s office, told a televised news conference in the capital.

The trial process and outcome drew condemnation abroad, with Human Rights Watch and a prominent international lawyer saying it was riddled with legal flaws and carried out amid widespread lawlessness undermining the credibility of the judiciary.

Eight ex-officials received life sentences and seven jail terms of 12 years each, Sadiq said. Four of the 37 defendants were acquitted, others got shorter jail terms.

Muammar Gaddafi himself was killed by rebel forces after being captured following months on the run.

Sadiq did not spell out the charges on which the verdict was based, saying this should await the expected written ruling. Defendants had been accused of a range of offences including war crimes and crimes against humanity involving the use of deadly force to suppress demonstrations, as well as corruption.

The verdict on Saif al-Islam was passed in absentia since he has been held since 2011 by a former rebel group in Zintan, a mountainous western region beyond central government control. Internal armed conflict has split Libya into factional fiefdoms.

Dressed in blue prison uniforms and seated in a black cage, 29 of the defendants including Senussi and Mahmoudi were present for Tuesday’s verdict. One of them began shouting after the ruling was read out before being led away.

Other defendants were being held in Misrata, a western city loyal to the current authorities in Tripoli.

Saif appeared by video link only at the start of the trial. The Zintanis have refused to hand him over, saying they do not trust authorities in Tripoli to make sure he does not escape, but agreed to let him be tried there.

The sentences can be appealed and must be confirmed by Libya’s Supreme Court, but legal experts and rights advocates said the proceeding was tainted and politicized from the start.

JUSTICE UNDER FIRE IN LIBYA

New York-based Human Rights Watch (HRW) said defense lawyers lacked full and timely access to case files and several had been unable to meet with clients in private while two had quit after receiving threats.

Slideshow ( 4 images )

“There are serious questions about whether judges and prosecutors can be truly independent where utter lawlessness prevails and certain groups are unashamedly shielded from justice,” Joe Stork, HRW’s deputy Middle East and North Africa director, said in an emailed statement.

“This trial was held in the midst of an armed conflict and a country divided by war where impunity has become the norm ...The victims of the serious crimes committed during the 2011 uprising deserve justice, but that can only be delivered through fair and transparent proceedings,” Stork said.The International Criminal Court (ICC) had wanted to try Saif al-Islam and Senussi in The Hague but in 2013 granted Libya the right to do so at home despite doubts about the impartiality and competence of its judicial system.

John Jones, a British lawyer hired to represent Saif al-Islam before the ICC, said a “show trial” led to the death sentences. “The whole thing is illegitimate from start to finish ... It’s judicially sanctioned execution,” Jones said.

The ICC does not allow the death penalty.

The trial began in April 2014 before fighting between rival factions in Tripoli erupted, and the power struggle has loomed large in the unraveling of state authority around the vast, oil-producing North African country.

Tripoli is now controlled by a self-declared government set up after an armed faction called Libya Dawn seized the capital in August, expelling the internationally recognized government, which then decamped to far eastern Libya.

Fighting involving remnants of the armed forces, ex-rebel groups, regional tribes and Islamist militants has sewn chaos in Libya and thwarted any post-Gaddafi transition toward democracy.