This is a common situation in the Islamic world. There are few democratic governments, dictatorships and monarchies being more common. Islamic radicals are not fans of democracies, but are also opposed to the monarchs and dictators that currently rule. While both the tyrants and Islamic radicals agree on hating the West, and particularly the United States, they are also enemies of each other. The West is seen as the cause of the poverty and backwardness of the Islamic world, while the Islamic radicals see the non-Moslem west as a pool of current enemies, and potential converts to Islam. But where the Islamic radicals live, they are a definite threat to the local government.
Dominated by relatively conservative Moslems, Mauritania has had a poor human rights record, and been the object of considerable Western pressure for its tolerance of slavery, forcible Arabization of non-Moslem populations, and tolerance for Islamist organizations, who have recruited and collected funds in the country. Of late, however, the government has been cracking down on at least some of the Islamists, particularly foreign ones. The resident alien leaders of several Islamist organizations have been detained, and in some cases apparently quietly turned over to other countries. This change in attitude may be prompted by a fear that foreign Islamists could threaten the current ruling clique, and also as a way to improve relations with the West.