Mauritania's new military leader General Mohamed Ould Abdelaziz, who took power in a coup earlier this month, says ending the "terrorist menace" is one of his first priorities.
By James Copnall
BBC News, Nouakchott
It was one of many justifications he gave for overthrowing the democratically-elected President Sidi Ould Cheikh Abdallahi.
But some analysts say he could be exaggerating the scale of the problem, while his intervention may actually have increased the threat in two ways.
Firstly, a statement believed to be from the leadership of the militant group al-Qaeda in the Islamic Maghreb (AQIM) was posted on a jihadist website criticising the coup as against the will of the people, and calling on them to act.
It has been much discussed by Mauritanians, many of whom worry about the implications of such a message.
Secondly, the US government froze funding for military co-operation in protest at the coup.
But with the military now in charge, the combat between extremists and the army is entering a new phase.
In the last few months, Mauritania has suffered a series of attacks blamed on AQIM.
In December last year, four French tourists were killed in the town of Aleg, prompting the organisers of the Paris-Dakar rally to cancel it because of fears of further attacks.
Then three Mauritanian soldiers were killed, and later the police and alleged members of al-Qaeda exchanged gunfire in the capital Nouakchott.
There was also an attack on the Israeli embassy - or on one of Nouakchott's few nightclubs next door, depending on who you believe.
Mauritania has always been perceived as a peaceful, some might say sleepy country, so the incidents provoked consternation at home and abroad.
Jemil Ould Mansour is the head of a moderate Islamist party, Tawassoul, which is gaining ground rapidly, in particular among the young and women.
He rejects charges his movement has links with more extremist currents of thought as political mudslinging by his opponents, and says the threat emanating from al-Qaeda has regional and cultural roots.
Mauritania's rampant poverty could fuel extremism
"We're a country which borders Algeria, Morocco and Mali," he told the BBC, noting that all three have problems with extremist groups.
"This extremist phenomenon exists in many Arabo-Muslim countries, in many countries in the Muslim world in general."
But not everybody believes Mauritania is in as much danger as is sometimes portrayed.
"You can't call what has happened here a real terrorist threat," says Yahya Ould el-Bara, a university professor and specialist on the question.
"Sure, there are young people who were in al-Qaeda, but they are isolated cases, maybe 20 people who travelled abroad to fight for al-Qaeda.
"But I think in Mauritania, it isn't on a big scale."
Mr Bara says Mauritania's tolerant form of Islam ensures most of his compatriots steer well clear of extremism in any form, and believes the tribal nature of Mauritania's society creates a sort of social solidarity that has much the same effect.
But Mr Bara does believe the problems of poverty, education, extremist preaching in mosques funded by Saudi Arabia, and the failure of democracy in Mauritania will cause the danger to grow.
Democracy's latest collapse occurred when Gen Abdelaziz took over in a bloodless putsch on 6 August, the fifth time in Mauritania's short history the military has seized power.
Gen Abdelaziz figured heavily in Mauritania's fight against extremism before the coup.
Gen Abdelaziz has been a key figure in the fight against terrorism
In an interview with the BBC, the usually laconic military man became animated.
"Terrorism is a real problem here," the general said.
"The forces of defence and security have done everything to end it, and they are still working.
"What we can guarantee is that we will not spare any effort to eradicate this evil."
Gen Abdelaziz also admitted military might wouldn't be enough.
"It's true that the armed struggle isn't the only effective way of dealing with this, we also have to find the roots of all these problems that are developing, and to treat them too, in other ways."
The US has been helping Mauritania combat Islamist extremism but may not cut such links.
The US believes Mauritania's geography - the country is essentially a difficult-to-patrol desert - poverty, and growing radicalism make it a potential haven for Muslim extremists.
But US support for the Mauritanian army is a double-edged sword, like the country's diplomatic relations with Israel - both enrage the more radical elements of Mauritanian society.
It is not yet clear how long America's decision to halt military co-operation will last, nor what practical effect it will have on the ground.
There is also a chance the new military rulers will change their tactics - or at least avoid committing some of the errors made by the ousted President Abdallahi.
"Sidi Ould Cheikh Abdallahi's policy was catastrophic," says Mohamed Fal Ould Oumere, the editor of La Tribune newspaper.
"When he was elected, he released a lot of prisoners, who he wrongly believed were falsely imprisoned, and he and his prime minister said terrorism did not exist.
"So the security forces went to sleep, and we all saw what happened," said Mr Oumere.
"General Abdelaziz, in fact the two generals who led the putsch, were in charge of destroying al-Qaeda, they're seen as enemies of al-Qaeda, so it's possible there could be more attacks.
"But I think we could finally get a really essential thing, something we have never had, a real strategy for fighting against terrorism," he said.
For the vast majority of Mauritanians "terrorism" remains something they hear about in other countries.
But there is no doubt there is a growing problem of extremism in the country, a phenomenon which worries both Mauritanians and the international community.