The alleged leader of a jihadist cell was handed a 20-year term with forced labour on Thursday in Senegal's largest terror-related trial, which also saw 14 suspects acquitted.
A Dakar court handed the term to Makhtar Diokhane, described as the ringleader of a group that planned to wage jihadism in West Africa, while Alioune Ndao, who had been accused of acting as coordinator, received a suspended one-month sentence.
The heavily-guarded proceedings, which started on April 9, are believed to have been the first mass prosecution for alleged terror activities in Senegal.
The majority-Muslim West African state has so far escaped major terror attacks.
The 29 suspects, three of them women, were accused of criminal conspiracy related to financing a terror group, money laundering, acts of terrorism and funding terrorism.
Most were arrested in 2015 in Senegal, which prosecutors said was their planned springboard to foment terrorism in neighbouring countries as well.
Diokhane, 31, was found guilty of criminal conspiracy to commit terrorist acts while Ndao was convicted for possessing a weapon without authorisation.
Three other defendants were sentenced to 15 years in jail with forced labour; six were given 10-year terms; and three were given five-year sentences.
Fourteen defendants, including two of Diokhane's wives, were acquitted.
Charges against another defendant were dropped due to irregularities in the proceedings, according to the judge on the case, Samba Kane.
The public prosecutor had requested life sentences against 11 of the accused and a 30-year sentence against Ndao, a popular imam from the town of Kaolack in central Senegal, as well as acquittals for eight other defendants.
The group was accused of wanting to set up a jihadist base in Senegal and then extend into neighbouring countries including The Gambia, Guinea and Guinea-Bissau.
"Proud of our justice system"
The 29 accused, some of which were said to have fought alongside Nigeria's Boko Haram, were standing in the courtroom as the verdict was announced.
When Ndao was handed a month-long suspended sentence - after public prosecutors requested a 30-year jail term - cries of joy were heard in the courtroom.
"We have been fighting for three years to save the dignity of Ndao, who is a role model for this country," Moussa Sarr, Ndao's lawyer, told reporters.
"Despite all the difficulties, we are proud of our justice system today," he added.
"If Ndao has been found guilty, it would only be because there are no just men in Senegal," one of his supporters told AFP.
Diokhane's lawyer said he would appeal.
"I have no intention of letting Makhtar Diokhane stay in prison for 20 years," attorney Alassane Cisse told AFP.
Senegal has so far escaped the Al-Qaeda-linked jihadist insurgency that has destabilised neighbouring Mali, and seen attacks on other west African nations including Burkina Faso and Ivory Coast.
But it has stepped up security outside hotels and publics buildings.
From early morning, long lines of onlookers formed to get into the courtroom, guarded by police checkpoints and metal detectors.
Senegalese Muslims primarily follow Sufi strands of Islam mixed with local beliefs - considered heretic by hardline Salafists - while moderate Islamic brotherhoods hold huge power in society.
Senegalese imam Ibrahima Seye was sentenced on appeal to two years in prison in October 2016 for glorifying terrorism, one of several people accused by the state of links to Al-Qaeda in the Islamic Maghreb (AQIM) and the Islamic State group.
* Sign up to News24's top Africa news in your inbox: SUBSCRIBE TO THE HELLO AFRICA NEWSLETTER
FOLLOW News24 Africa on Twitter and Facebook