Residents said they believed that young Islamist officers from an armoured unit and the air force were behind the attempt.
The coup attempt is believed to have started at about 1:45 am (0145 GMT) when automatic weapons fire and explosions were heard mainly around the presidential building and army headquarters.
|Taya is accused of keeping a|
firm grip on power
The shooting died down at dawn but intensified later in the day.
First reports of casualties said that only several soldiers and civilians were admitted to hospital for treatment to their injuries.
Hospital sources did not give details on the number of people injured.
An eyewitness said he had seen two civilians hit by a mortar near an army tank base.
Crackdown on Islamists
Mauritanian authorities had conducted a recent crackdown on Islamists and politicians hostile to the US-led war on Iraq.
On Tuesday, 36 people were charged with plotting against the constitutional order, incitement to undermine security at home and abroad, and belonging to illegal organisations.
In May, Mauritanian Prime Minister, Sheikh al-Avia Ould Mohammed Khouna, warned that Islamic movements were recruiting youngsters to their cause.
Many Mauritanians are unhappy with their government’s ties with Israel.
The former French colony was the third Arab country to establish full diplomatic relations with Israel in 1999.
Taya seized power in 1984 through a coup, before winning elections in 1997. He was due to have run for elections again in November.
Human rights groups have frequently said that his government has used oppressive methods to maintain a firm grip on power.