Updated

Security forces opened fire on a car loaded with explosives early Wednesday as it attempted to speed into the capital, setting off an enormous explosion and killing three suspected al-Qaida-linked militants, an official said.

The al-Qaida affiliate claimed responsibility for the attempted attack in a telephone call to an Islamist website, Essirage.net. The caller, who identified himself as a spokesman for al-Qaida's North Africa branch, said they were targeting President Mohamed Ould Abdel Aziz whose government has actively pursued members of the terror cell.

Defense Minister Hamadi Ould Hamadi, however, told reporters late Wednesday the target was the French Embassy and a military installation.

An enormous explosion rocked the neighborhood of Ryad nearly six miles (10 kilometers) from the city center.

Authorities had been tracking the suspicious vehicle and two others since Friday when they entered the country from northern Mali. Hamadi said that security forces were able to apprehend one of the all-terrain vehicles, arresting a suspected al-Qaida militant who confessed the plot including the target and the direction of travel.

The army then worked to corner the second car, a Toyota Land Cruiser carrying 1.5 tons of explosives, guiding it into an uninhabited area at the southern perimeter of the capital where they were able to open fire, he said.

Once a peaceful nation perched on the edge of the vast Sahara desert, Mauritania has become a staging ground for al-Qaida's North African franchise, which has bankrolled its operation by kidnapping foreigners for ransom across a wide swath of the Sahel region.

Col. Mohamed Ould Ahmed, a military spokesman, said that two suspects had been arrested Tuesday after they abandoned one of the other SUVs in the desert. It was full of explosives.

Security forces were still searching for the third vehicle, which was believed to be carrying water, gas and video equipment. Ahmed said that they were confident they would find and arrest the three suspects in that car.

Al-Qaida in the Islamic Maghreb, or AQIM, has its roots in an extremist Islamic group in Algeria that brokered an alliance with the terror network in 2006. Since then, AQIM has kidnapped more than a dozen Europeans including tourists and aid workers, and with each abduction their tactics have become more bold.

They stormed a heavily guarded residential compound in northern Niger late last year, seizing five French hostages and two others. AQIM gunmen also grabbed two Frenchmen from a restaurant in Niger's capital last month, and the men were found dead less than 24 hours later.

In Mauritania, AQIM has claimed responsibility for a string of attacks, including the 2009 killing of 39-year-old American Christopher Ervin Leggett and the 2007 slaying of four French tourists picnicking on the side of a rural road.

Aziz, a military general, led a coup in 2008 and among his critiques of the democratically elected president that he ousted is that he had been soft on terrorism. He was later elected in multiparty elections in which he promised to contain the terror group.

Dozens of suspected followers of the cell have been arrested and prosecuted since Aziz took office and he created specialized units within the army dedicated solely to fighting al-Qaida. Last year, the army led a controversial cross-border raid into northern Mali to destroy an AQIM base. The raid was executed with the help of the French military.

In the statement published on the Islamist website, the man identifying himself as an AQIM spokesman said the attack was a reaction to the new collaboration between Mauritania and France.

"The operation that was undertaken this morning was aimed at taking out Mauritanian President Mohamed Ould Abdel Aziz in response to the fact that he has become an agent of France to whom he has opened his country in order to wage war against us," it said.