BEIRUT — A Lebanese military tribunal on Thursday sentenced a radical Sunni cleric to death for his role in 2013 clashes that killed 18 soldiers, following a trial that lasted for two years.

The firebrand cleric, Ahmed al-Assir, had gained support in southern Lebanon for his vocal criticism of the powerful Shiite militant Hezbollah group’s involvement in Syria’s civil war, sparking tension between Sunni and Shiite Muslims who support opposing sides.

What started as clashes between al-Assir’s supporters and opponents turned into a deadly, days-long standoff with the Lebanese army that left 18 soldiers dead. The cleric used Twitter and Facebook at the time to call on supporters to join the fight with the army and urged soldiers to defect from the military.

After the clashes, al-Assir went into hiding and was only caught two years later trying to flee Lebanon in disguise and with a forged passport.

The court convicted al-Assir of illegal possession of weapons and pre-meditated killing of soldiers. He was also accused of forming an armed group that undermined the state’s authority and inciting sectarianism.

During the trial, he refused to recognize the court’s authority and before Thursday’s sentencing, he repeated his claim that the tribunal is politically motivated and accused it of being influenced by Iran, the main backer of Hezbollah and Syrian President Bashar Assad.

According to an official, al-Assir was not present during the verdict, though he had attended the hearings earlier, along with 21 other defendants in the case. At least 11 others were tried in absentia.

The court also handed down death sentences to six other defendants, all in absentia. Al-Assir’s two sons, who were also tried in absentia, got life in prison while a famous singer and cleric’s supporter, Fadl Shaker, was sentenced to 15 years. Shaker was also tried in absentia.

After the ruling became public, families of the defendants blocked the road in the southern town of Abra to protest the verdict. Al-Assir’s lawyers have 15 days to appeal the verdict.

In Beirut, al-Assir’s relatives and supporters gathered outside the military tribunal. Women carried posters denouncing the trial as a “conspiracy.”

The last time Lebanon carried out a death sentence was in 2004.