Thirteen anti-slavery activists in Mauritania have been sentenced to up to 15 years in prison for their alleged role in a riot in June.

A tribunal found the members of the Resurgence of the Abolitionist Movement (IRA) guilty on Thursday of counts including attacks against the government, armed assembly and membership of an unrecognised organisation.

The defendants said they were not present at the June protests and that the trial was a politically motivated attempt by the government to discredit their organisation.

The decision was condemned on Friday by international campaigners as a "devastating blow to the Mauritanian anti-slavery movement".

Sarah Mathewson, Africa Programme Manager at Anti-Slavery International, said that the activists were "clearly being targeted by the government for their work to expose and denounce slavery, still commonplace in the country".

IRA Vice President Brahim Ramdane called the verdicts a "parody of justice" and said the group's lawyers were deciding how to respond.

READ MORE: Meet the woman freeing Mauritania's slaves

The activists were arrested in late June and early July after a protest against eviction by residents of a slum in the capital Nouakchott, many of whom are themselves former slaves.

Several police officers were injured in the demonstration.

Mauritania is a focus of activism by the modern anti-slavery movement over a practice believed to affect between 4 and 20 percent of the population.

The West African nation has attempted to crack down on slavery and last year passed a law making it a crime against humanity and doubling prison terms for offenders. Campaigners say it will not be enough to stamp out the practice.

The Nouakchott slum was home to many so-called Haratin - a "slave caste" under a hereditary system of servitude whose members are forced to work without pay as cattle herders and domestic servants.