Ghana's John Dramani Mahama urged respect for results giving him victory in presidential polls after the opposition alleged fraud in a nation trying to uphold its image as a model African democracy.
There were no reports of trouble on the streets of the west African nation's capital Accra on Monday morning after the closely fought polls that led to mounting tension ahead of the announcement of the results late Sunday.
Celebrations broke out after the results announcement, with hundreds of ruling party supporters gathering in the streets, blowing horns, dancing and waving flags.
"I call on all leaders of all political parties to respect the voice of the people," incumbent Mahama, only in office since the death of his predecessor in July, said in a victory speech. "The voice of the people is the voice of God."
The stakes of the election held over Friday and Saturday were especially high in a country with a booming economy fuelled partly by a new and expanding oil industry.
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 percent of the votes cast, compared to Akufo-Addo's 47.74 percent. With eight candidates in the race, more than 50 percent was needed to avoid a second-round runoff.
Akufo-Addo's New Patriotic Party said 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 which also called on its supporters to remain calm.
The head of the country's Peace Council, a multi-party platform set up to facilitate peaceful polls, told local radio that the electoral commission met with the two parties for more than an hour before announcing the results.
Akufo-Addo's party was given a chance to present its case, but the electoral commission found that more evidence was needed, Citi FM reported on its website.
"The agreement was that the (commission) would announce the winner while the NPP can seek the proper redress through the channels laid down as they produce further evidence to facilitate that," Emmanuel Asante told the station.
Turnout was put at more than 79 percent. 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 candidate or subtracted from the NPP presidential candidate."
In the wake of the opposition claims and before the results announcement Sunday, 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.
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.
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 is a key issue. Mahama advocated a large investment in infrastructure, while Akufo-Addo promoted his signature policy of free secondary education in the country of 24 million people.