Mauritania has jailed three men for between five and 10 years for links with the Islamic State group, a judicial source said on Wednesday.
A court in the capital Nouakchott handed down the sentences late on Tuesday after a trial lasting just one day, the source said on condition of anonymity.
The men, whose ages were not specified, were convicted of "belonging to a terrorist organisation and possession of terrorist propaganda" following their arrest in October last year.
They denied the charge but the court was shown a video in which all three pledged allegiance to IS, the source said.
The group ringleader received 10 years while the other two received five and seven year sentences.
The convictions were the first for links to IS in Mauritania, although the country is holding 30 prisoners for involvement with Al-Qaeda, 10 of them on death row.
The spotlight has been thrown on the growing threat of Islamist extremism across Africa's vast Sahel region since a French-led military intervention drove Al-Qaeda-linked groups out of the towns of Mali's desert north in 2013.
French Foreign Minister Laurent Fabius has referred to the lawless, arid hinterland, stretching from Senegal in the west to Somalia in the east, as "Sahelistan" -- the new front in the global fight against terrorism.
Kidnappings and attacks by Al-Qaeda in the Islamic Maghreb (AQIM) were frequent when Mauritania's President Mohamed Ould Abdel Aziz came to power in 2008.
But he boasts that he has turned his nation into a regional haven of peace thanks to his reorganisation of the military and security forces.
The mainly Muslim republic, sandwiched between the west coast of Africa and the Sahara desert, is seen by Western leaders as a bulwark against Al-Qaeda-linked groups.
In 2010 and 2011, Mauritanian troops carried out successful "preventative" raids on AQIM bases in neighbouring Mali, before the armed fundamentalists could carry out planned attacks on Mauritania.