Accra, Ghana (CNN) -- Ghana's Supreme Court Thursday declared President John Dramani Mahama "validly elected" as the court dismissed all claims of voter fraud, mismanagement and irregularities in the West African nation's December 2012 presidential election.
After the election, Ghana's Independent Electoral Commission declared Mahama the winner with 50.7% of the vote, narrowly avoiding a runoff with his main challenger, Nana Addo Dankwa Akufo-Addo.
But challenges followed, with allegations of widespread mismanagement and voting irregularities at more than 10,000 polling stations. Akufo-Addo and two other officials of his New Patriotic Party sued and the case went to the Supreme Court.
Mahama, from the ruling National Democratic Congress party, was sworn in as president, and Thursday's court ruling means he will retain the office.
The Supreme Court dismissed all six claims alleging fraud and irregularities, with judges ruling unanimously against claims that certification forms had duplicate serial numbers, that votes from phony polling places were counted, and that there was duplication of polling station codes, meaning that votes from a particular voting station might have been counted twice or more.
Akufo-Addo made a statement after the ruling was announced, saying he will not seek a court review of the decision, congratulating President Mahama and calling on Ghanaians to work out their "differences, ease tensions between us and come together and build our country."
The famously easy-going people of Ghana had been on edge awaiting Thursday's decision by the court.
Nine Supreme Court justices spent 48 days hearing the case, which had riveted the nation.
The proceedings were broadcast live on Ghanian television and radio, the first time the court has allowed such broadcasts. They have been immensely popular.
Ghana is one of Africa's fastest-growing economies. It is the world's second-largest cocoa producer, after Ivory Coast, and the continent's second biggest gold miner, after South Africa, according to the United Nations.
But critics say that despite the rich resources that bring billions of dollars annually, the wealth is not trickling down to the rural poor who live on the land where the gold is mined.
In March 1957, Ghana became the first sub-Saharan European colony to declare independence from a colonial ruler, in its case, Britain. It endured four military coups in the first 14 years, after one of which, three former presidents were executed.
Then, in the election of 2000, it had its first peaceful transfer of power between civilian presidents. The incumbent won a second term in 2004, but term limits prohibited him from seeking a third term in 2008.
In that election, John Atta Mills of the National Democratic Congress narrowly defeated Akufo-Addo. But Mills died in office last year, elevating his vice president, Mahama to the presidency.
Last December, Mahama ran for a full term against Akufo-Addo, setting off the Supreme Court battle.