* President accidentally shot by soldiers outside capital
* Appears on television to urge calm
* Will be treated in French military hospital
By Laurent Prieur
NOUAKCHOTT, Oct 14 (Reuters) - Mauritania's president was flown to France for medical treatment on Sunday after the Western ally against al Qaeda was shot by soldiers in what he said was an accident.
The shooting late on Saturday 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 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," 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 his wounds was not clear. Medical sources said he had been shot in the abdomen, though the government announced he had been "lightly wounded."
The president was flown to former colonial power France on Sunday morning after undergoing an initial operation in a military hospital in the Mauritanian capital Nouakchott.
The French defence ministry confirmed Aziz would receive treatment at the Percy-Clamart military hospital on the outskirts of Paris.
Abdel Aziz was wounded late on Saturday when soldiers opened fire on his car about 40 km (25 miles) from Nouakchott, the government said. He was driving through the town of Toueila, in an area where he owns a ranch.
Officials did not say what had happened to the soldiers who had opened fire on the convoy.
"It was a unit of the Mauritanian army, a mobile control unit. They weren't aware of his passage," Foreign Minister Hamadi Ould Hamadi told Reuters on Sunday.
The streets of the capital were initially deserted as rumours spread of a military coup or of an assassination attempt against the president by Islamic militants.
But as reports of the incident spread, hundreds of residents converged on the military hospital where Abdel Aziz was being treated to show their support for the president.
Life had largely returned to normal on Sunday, with shops opening and cars returning to the streets. No additional police or military presence was visible.
As the head of one of West Africa's more effective armies, Abel Aziz ordered military strikes against Islamist bases in neighbouring Mali in 2010 and 2011, provoking threats of revenge from the al Qaeda-linked fighters.
Those Islamist groups now occupy the northern two-thirds of Mali after hijacking a Tuareg rebellion there earlier this year and launching a rapid offensive in the wake of a military coup in the capital Bamako.
The events in Mali have pushed thousands of refugees into Mauritania, placing a strain on resources and raising tensions along the two countries' long, desert border.
While security, including more military patrols, has been beefed up to combat the threat of foreign Islamists, Abdel Aziz often travels with only a light armed escort.
"Security is too loose. That should be revised. We all must pay attention to roadblocks, patrols and military zones, especially in this time when the Sahel region is unstable," said Mohamed Fall Ould Oumer, of the weekly newspaper La Tribune.
"If the president had died it could have been a threat to stability within the country and in the region," he said.
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
Split between black and Arab Africa, Mauritania is bigger than Turkey but has only 3.5 million people. The largely desert country produces oil from wells offshore. Its other main export industries are mining and fishing.