The electoral commission announced the result after a day of twists and turns linked to the vote on Friday and Saturday, with the stakes especially high in a country with a booming economy fuelled partly by newly discovered oil.
Results compiled by local media had early Sunday pointed to a Mahama win, leading the opposition to strongly reject them, alleging fraud and claiming it had evidence that its candidate, Nana Akufo-Addo, was the real winner.
According to the electoral commission, Mahama won with 50.70% of the votes cast, compared to Akufo-Addo’s 47.74%. With eight candidates in the race, more than 50% was needed to avoid a second-round runoff.
“I call on all leaders of all political parties to respect the voice of the people,” Mahama said in a victory speech in which he also urged restraint in celebrations and said he was overwhelmed.
“The voice of the people is the voice of God.”
Akufo-Addo’s New Patriotic Party said in a statement that the results announced “by the evidence do not reflect the mandate of the required majority of the Ghanaian electorate.”
Party officials would meet Tuesday to decide the way forward, it said in a statement.
Turnout was put at more than 79%. Observers from the Commonwealth, West African bloc ECOWAS and local group CODEO all said the vote appeared peaceful and transparent.
The opposition however issued a scathing statement even before the official results were announced.
“Indeed, we have enough concrete evidence to show that the 2012 presidential election was won by our candidate, Nana Akufo-Addo,” it said.
“We have noticed a pattern of fraud, where substantial numbers of votes are either added to the NDC (National Democratic Congress) candidate or subtracted from the NPP presidential candidate.”
It demanded an audit of collated vote figures as well as of data from the biometric verification machines used in the election.
In the wake of the opposition claims and before the results announcement, a crowd of about 300 NPP supporters had gathered near the electoral commission. Security forces fired tear gas at one point in an apparent bid to move them back.
Tanks and anti-riot police guarded the outside of the commission building for the announcement of the results. Armed police were in the room for the announcement and escorted the electoral chief out afterward.
Asked earlier about the NPP allegations, electoral commission spokesman Christian Owusu-Parry told AFP “what I know is that they are claiming there are disparities in some results and the commission has asked them to bring evidence.”
As for whether any evidence had been supplied, he said, “no, not yet”.
The 54-year-old Mahama, previously vice president, has only been head of state since July following the death of his predecessor John Atta Mills.
He is also a writer and devotee of Afrobeat music who recently published a memoir, “My First Coup d’Etat — And Other True Stories from the Lost Decades of Africa.”
In the book, he says he was forever changed by his boyhood experiences during a 1966 military coup.
Akufo-Addo, 68, is a Britain-trained human rights lawyer and son of a former president. He lost the 2008 polls by less than one percentage point.
Ghana’s presidential and parliamentary polls were held on Friday, but polling stations in some areas re-opened on Saturday after problems with a new biometric system and late delivery of materials led to delays.
Elections since the return to civilian rule in 1992 have seen both parties voted out of office, establishing Ghana’s democratic credentials in a region that has had its share of rigged polls and coups.
Ghana is also a top exporter of cocoa and gold, with economic growth of 14 percent in 2011. Eight percent growth is expected this year and next.
How to spend Ghana’s newfound oil money has been a key issue, with crude production having begun in late 2010.
Mahama has advocated a large investment in infrastructure, while Akufo-Addo promoted his signature policy of free secondary education in the country of 24 million people.