Former cabinet minister Sidi Ould Cheikh Abdallahi has won Mauritania's historic presidential election, the interior minister has said.
Mr Abdallahi was backed by anti-slavery campaigners
He gained 53% of the ballots cast in Sunday's run-off, against 47% for opposition leader Ahmed Ould Daddah.
The elections were seen as the fairest since the largely desert country gained independence from France in 1960.
They cap the restoration of civilian rule after a 2005 coup. The military junta was banned from contesting.
Previous elections were dismissed as being rigged in favour of the ruling party candidates.
"I hereby proclaim that the next president of the Islamic Republic of Mauritania will be Sidi Ould Cheikh Abdallahi," said Interior Minister Mohamed Ahmed Ould Mohamed Lemine.
Mr Abdallahi, 68, is supported by a coalition of 18 groups previously loyal to the regime of the ousted authoritarian leader, President Maaoya Sid'Ahmed Ould Taya.
SIDI OULD CHEIKH ABDALLAHI
Minister under ex-President Taya
Later put under house arrest
Seen as army's candidate
Backed by anti-slavery campaigner
He was also backed by the third- and fourth-placed candidates from the first round and a leading anti-slavery campaigner.
The BBC's Richard Hamilton says he was also seen as the army's favourite candidate.
Mr Daddah, 65, an economist and brother of Mauritania's first post-independence leader, unsuccessfully ran against Mr Taya in 1992 and 2003.
He gained most votes in the capital, Nouakchott and his home Trarza region in the south-east, officials say, while Mr Abdallahi won Mauritania's other 11 regions.
EU observer mission chief Marie-Anne Isler Beguin on Sunday praised the electoral process.
"Nothing has stopped the process. There have been no incidents, no unauthorised people in polling stations," she said.
The ballot, in which 1.1 million people were eligible to vote, marks the final stage of a programme to restore civilian rule.
Mr Abdallahi gained most votes in the first round two weeks ago but failed to get the 50% needed for victory.
The interior minister put voter turnout at 67% - slightly down on the first round.
Both candidates were members of the so-called White Moor elite and spent time in prison under previous military rulers.
They both pledged tough measures against slavery, which was banned in 1981 but which still persists.
Mauritania is an ethnically diverse mix of Arabic-speaking Moors and black Africans.
The large Black Moor population are current and former slaves of the fairer-skinned ruling elite, the White Moors.
Mr Abdallahi pledged "special legislation" criminalising slavery while his rival, Mr Daddah, promised compensation for slaves and penalties for law-breakers.
Mr Taya was deposed by Colonel Ely Ould Mohamed Vall, whose military council took power in August 2005.