Mr Abdallahi became Mauritania's first democratically elected leader in 2007 after a coup two years earlier, partly instigated by General Mohamed Ould Abdelaziz.
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.