Soldiers were plotting to overthrow President Adama Barrow in 2017 with the help of his ousted predecessor, court said.

A court martial in The Gambia has sentenced eight former soldiers to jail for plotting to overthrow President Adama Barrow in 2017 with the help of his ousted predecessor.

The soldiers were led by a former military aide to former president Yahya Jammeh, who ruled the West African country for 22 years before losing an election in late 2016 to Barrow and then refusing to step down.

The plotters, who had pleaded not guilty, were charged with nine counts including treason for conspiring to detain ministers and military officials, and attack an international force that had been set up in The Gambia to retain order after Jammeh’s rancorous departure.

Seven of the accused received a nine-year sentence and one got three years.

They were in contact with former president Jammeh over the messaging service WhatsApp and discussed attacking troops in areas of the country still considered loyal to the former president, according to the court martial records.

Rights groups and the current government say Jammeh’s 22-year rule was marred by human rights abuses and fraud, allegations Jammeh denies.