Mauritania's president was flown to France for surgery today after he was shot by soldiers in what he said was an accident.

The shooting late last night set the coup-prone northwest African country on edge and President Mohamed Ould Abdel Aziz appealed to Mauritanians to keep calm in a televised message from his hospital bed.

Although Mauritania has been stable politically since Mr Abdel Aziz seized power in 2008, it lies on the fringes of the Sahara Desert where Islamist gunmen hold increasing sway.

"I want to reassure everyone about my state of health after this incident committed by error," Mr Abdel Aziz said from his bed.

"Thanks to God, I am doing well."

He was covered in a sheet up to his neck and the extent of the wounds was not clear. Medical sources said he had been shot in the abdomen.

The president was flown to France, the former colonial ruler of Mauritania, for further treatment, Communications Minister Hamdi Ould Mahjoub told Reuters.

Mr Abdel Aziz was wounded when a military patrol opened fire on his convoy about 40km from the capital, Nouakchott, the government said.

He was driving from the town of Toueila, where he has a ranch.

Officials did not say what had happened to the soldiers who had opened fire on the convoy.

Mauritania launched numerous military operations on Islamist bases in neighbouring Mali before a rebellion split that country in two in March, leaving much of it in the hands of heavily-armed groups linked to al-Qaeda.

Mr Abdel Aziz was elected in 2009 after seizing power a year earlier in a coup that cut short the rule of Mauritania's first democratically elected president, who had reached out to Islamists.