Celebrations on a Nouakchott street
Mauritania's president has praised loyal troops for putting down an attempted coup, in his first broadcast since fighting erupted on Sunday morning.
Earlier troops had retaken the centre of the capital, Nouakchott, from mysterious rebel forces after heavy fighting.
President Maaouiya Ould Taya said that it had taken some time to regain control of the city "because it was necessary to destroy tank after tank".
"As I speak, the operation is complete," he announced in a radio and television broadcast.
Some residents have begun celebrating, blasting car horns and shouting "Viva Maaouiya, viva Maaouiya".
Dominated by light-skinned Arabic-speakers (Moors)
Campaigners say slavery still practised
Black Africans complain of discrimination
Mostly Sahara desert
The uprising has been the most serious challenge so far to the rule of President Taya, who took power in a coup of his own in 1984 and later made enemies among the country's Islamists.
The rebels did not issue any statement. The president said they were "officers of the national army" with sources suggesting the rebels were led by a former colonel, Salah Ould Hanana, with backing from units of the army and the air force.
He is now reported to be in hiding with two other captains. Other mutineers are said to be arrested.
Other mutineers are said to be being held by loyalists.
Hospitals have been struggling to cope with the casualties and many residents fled their homes during the fighting.
Earlier in the day there were reports of heavy government reinforcements entering Nouakchott from the north.
There are also unconfirmed reports that senior commanders on both sides were killed in the fighting.
The insurgents were believed to have taken key government buildings on Sunday.
During the fighting, the president's whereabouts was unknown, with President Taya's staff only saying that they were in a "safe place".
The rebellion began early on Sunday, when tank and small arms fire was heard around the presidential palace and at the airport.
Later smoke was seen rising from the palace, thought to have been taken by the insurgents. There were also reports of widespread looting.
I have decided to lock everyone inside, all members of my family, because we are too scared to go out
There were unconfirmed reports that the army chief-of-staff, Colonel Mohammed Lamine Ndiayane, was killed in Sunday's fighting.
Most people in Nouakchott barricaded themselves in their homes.
"I have decided to lock everyone inside, all members of my family, because we are too scared to go out," said a resident contacted by phone by the Associated Press news.
Several reports suggested the rebels are sympathetic to Iraq.
Nouakchott has been a city under siege
While Mauritania is officially an Islamic republic, the authorities have cracked down on suspected Islamists and politicians with links to Saddam Hussein since the beginning of the war in Iraq.
The country is one of only three states in the Arab League to hold full diplomatic relations with Israel, and correspondents say the population is largely opposed to these ties.
Mauritania is deeply divided between three main groups - light-skinned, Arabic-speakers, the descendents of slaves and dark-skinned speakers of West African languages.