Keita's winning announcement comes after his rival, Soumaila Cissé, conceded defeat on Monday in a poll meant to draw a line under more than a year of turmoil.
Keita (68), universally known by his initials IBK, will now have access to $4-billion in international development aid to rebuild the West African country after a French military intervention in January ended Islamist rebels' occupation of the northern two-thirds of Mali.
He inherits a broken nation and must move quickly to overhaul the armed forces, tackle ingrained graft and negotiate peace with northern Tuareg fighters clamouring for more autonomy from the southern capital Bamako.
The concession by his rival Cissé, who had complained only hours earlier that Sunday's second-round vote had been marred by fraud, hands Keita a strong mandate to undertake reform in the landlocked former French colony, one of the world's poorest countries.
"My family and I went to congratulate Mr Keita, the future president of Mali, on his victory. May God bless Mali," Cissé, a former finance minister, said on his official Twitter feed.
A spokesperson for Cissé, who comes from northern Mali, said his candidate had admitted defeat after it became clear Keita had won even in Gao, the largest town in the north.
Keita, who earned his reputation for firmness by crushing student protests as prime minister in the 1990s, had been widely expected to clinch Sunday's runoff. He swept a July 28 first round with nearly 40% of votes on a ticket to restore dignity and order to a nation once regarded as a model for democracy in a turbulent region.
International and local observers said that, barring some small irregularities, the election was exemplary. France had pressed for the vote to go ahead quickly as it draws down its 3 000 remaining troops in Mali and hands over to a UN peacekeeping mission, despite fears a rushed process might undermine the legitimacy of a new president.
'Return to a normal democracy'
"This election, from a democratic standards point of view, is a success," said the head of a European Union observer mission, Louis Michel. "It is an election that allows Mali now to start finishing the process that it has begun: the return to a normal democracy."
Keita has said his top priority will be to secure lasting peace for northern Mali, which has been racked by five bloody rebellions since independence from France in 1960. Light-skinned Tuaregs have accused successive black African governments in the south of marginalising the underdeveloped region.
Tuaregs took up arms again early last year, alleging Bamako had violated a 2006 peace accord meant to develop the north. Former president Amadou Toumani Touré's failure to tackle that revolt led to the coup which tipped the country into chaos.
Keita has promised to open inclusive talks with all the peoples of northern Mali – black African, Arab and Tuareg – but many in the south are hostile to funnelling more of Mali's scarce resources to a region they see as responsible for the country's plight.
"There is a challenge of national reconciliation," said Chris Fomunyoh, senior associate for Africa at the National Democratic Institute in Washington. "There is a lot of unease between ethnic groups, not just north versus south, but even within the north itself."
The 12 600-strong UN peacekeeping mission being deployed will take over responsibility for security as France whittles down its contingent to just 1 000 troops – a rapid reaction force meant to tackle any outbreaks of Islamist violence.
An EU mission is also retraining and equipping Mali's armed forces, demoralised by last year's defeats at the hands of the Tuaregs and al-Qaeda-linked Islamist rebels.
Mujwa, one of three Islamist groups which seized control of northern Mali last year, had threatened to carry out attacks on polling stations in northern Mali before the July 28 first round but the electoral process passed off without any violence.
"This was an important stage in the transition in Mali towards peace and reconciliation," the UN's special representative for Mali, Bert Koenders, said. "The lack of violence was impressive in a country which has just emerged from conflict." – Reuters