Mauritania President Mohamed Ould Abdel Aziz was "lightly wounded" after a military patrol accidentally fired on his convoy, the government said on Saturday.
Mr. Abdel Aziz is undergoing treatment at a military hospital in the capital Nouakchott, a source at the presidency and two military sources told Reuters.
They did not give further details and it was not immediately clear why the military convoy opened fire on the convoy.
"On his way back to Nouakchott, the presidential convoy was shot by a Mauritanian patrol...as they did not recognize his convoy," Communications Minister Hamdi Ould Mahjoub said on national television.
"The president was shot on that occasion, but he is lightly wounded and his life is not threatened," he said.
Word of Mr. Abdel Aziz's shooting triggered talk across Nouakchott that he had been targeted by Islamists.
Mr. Abdel Aziz was elected in 2009 after coming to power in a 2008 coup and he is now seen by Western nations, including France, as a key ally in tackling al Qaeda in the region.
Security forces blocked roads leading to the military hospital, but security did not appear to be heightened around the presidential palace or other official buildings, according to a Reuters witness.
Mauritania launched numerous military operations on Islamist bases in neighbouring Mali before a rebellion in that country split it in two, placing its vast desert in the hands of heavily-armed groups linked to al Qaeda.
Mauritania, which straddles black and Arab Africa on the West coast of the continent, has enjoyed several years of relative political stability. Mr. Abdel Aziz has faced some protests over complaints ranging from corruption to his poor handling of a recent food crisis.