Mali's Constitutional Court on Monday declared Ibrahim Boubacar Keita president after the 73-year-old incumbent won elections that his opponent, former minister Soumaila Cisse, said were marred by fraud.
Keita was victor in a runoff on August 12 that, according to official results issued by the court after a one-hour session, gave him 67.16 percent of the vote.
He will begin his second five-year term on September 4.
"I will serve Mali according to republican principles," Keita said in his first comment since his election victory was confirmed.
He also said he "extends a hand" to help the country to his opponent Cisse, 68, who picked up 32.84 percent of the vote, according to the official results.
Keita's re-election came despite fierce criticism of failures to tackle jihadist violence and ethnic tensions that have rocked the impoverished Sahel state.
His major challenge as he starts the new term will be to strengthen a 2015 peace accord between the government, government-allied groups and former Tuareg rebels that the government sees as a cornerstone of peace.
In congratulating Keita, the European Union stressed the need for a rapid implementation of the peace accord -- as did the United States -- to meet the challenges of security and improved living conditions for the population.
"These challenges need more than ever an inclusive and constructive dialogue between all the political and social forces in Mali," an EU spokesperson said in a statement.
But Cisse had filed a petition with the Constitutional Court to say that that some of the results were rigged. By his calculation he won the election with 51.75 percent of the vote.
The court rejected his petition as being inadmissible or unsupported by evidence.
Cisse's campaign chief, Tiebile Drame told AFP, however, that "the Constitutional Court has issued a ruling that confirms the fraudulent nature and manipulation of the results."
"There's no need for transparent and credible elections in Mali any more," he added.
Observer missions sent by the EU and the African Union (AU) have said the election was not badly impaired.
Mali, a landlocked nation home to at least 20 ethnic groups where the majority of people live on less than $2 (1.76 euros) a day, has battled jihadist attacks and intercommunal violence for years.
Islamist attacks have spread from the north to the centre and south of the vast country and spilled into neighbouring Burkina Faso and Niger, often inflaming communal conflicts.
France, which intervened to root out jihadists in northern Mali in 2013, still has 4,500 troops in the country.
They are deployed alongside the UN's 15,000 peacekeepers and a regional G5 Sahel force, aimed at fighting the insurgents and restoring the authority of the state in the lawless north.
The economy, alongside security, is the other major challenge facing Keita.
Income per capita has fallen since 2014, according to the World Bank, and nearly half of the 18 million population live in poverty.