The group, from Barcelona Accion Solidaria, were seized on Sunday near the northern city of Nouadhibou.
They were in a four-wheel drive vehicle at the back of a convoy when they were attacked.
Senior officials said President Mohamed Ould Abdelaziz dismissed the head of the national gendarmerie on Wednesday, but gave no reason.
The German DPA news agency reported that Col Bekrine was directly responsible for security on the road that leads from Nouadhibou to the capital, Nouakchott.
Local media reports quoted unnamed officials as saying the Spaniards were being taken out of the country by their captors.
They said the likely destination was Mali, where al-Qaeda's North African affiliate, known as al-Qaeda in the Maghreb, is believed to have a large camp.
Analysts say Mauritania has generally been a peaceful country - but several attacks linked to the al-Qaeda cell have rocked the status quo.
An American teacher was killed in June, with al-Qaeda later claiming it had killed him for spreading Christianity.
In August a suicide bomber set off an explosion outside the French embassy in Nouakchott, injuring two guards, while four French tourists were killed in December 2007.