ACCRA, Aug 29 (Reuters) - Ghana's Supreme Court on Thursday rejected an opposition challenge to President John Mahama's victory in presidential elections, a ruling that should ease political uncertainty in the booming African oil- and cocoa-exporting country.

Mahama narrowly clinched December's vote with 50.7 percent of the ballot but the opposition New Patriotic Party (NPP) had alleged fraud ranging from inflated tallies to the participation of unregistered voters.

Justice William Atuguba, president of the nine-member panel, told a packed courthouse in downtown Accra that the tribunal had dismissed the opposition appeal - a ruling broadcast live to the transfixed West African nation.

"The overall effect is that the first respondent (Mahama) was validly elected," Atuguba said.

Supporters of the ruling National Democratic Congress (NDC) broke into song when the ruling was announced. Opposition leader Nana Akufo-Addo expressed disappointment but said his party would abide by the court ruling.

"Our reaction to this judgement will be watched keenly in Africa and beyond and will set a precedent for generations to follow," he told reporters. "It is now up to all Ghanaians to put the disputes behind us and come together."

Many in Ghana hope the court's detailed ruling - broadcast live across the nation of 25 million people - will set a precedent on a continent where election challenges are often swept under the carpet.

Legal experts had expected the court to dismiss the opposition case, saying it had failed to conclusively prove a level of fraud that would have changed the election result.

BOLD ECONOMIC MEASURES

The ruling should settle the political scene in the country that has built a reputation for political stability in turbulent West Africa.

"Let peace rein. This is a victory for Ghana's democracy," Mahama said via his Twitter feed.

Mahama said later in a broadcast speech that he believed the court ruling would remove uncertainty over his mandate and give him the opportunity to take the bold measures to tackle challenges Ghana's economy was facing.

"There are various reforms that must take place, bold decisions that must be made," he said in the televised speech to the nation. "I assure you that I am prepared and committed to take those decisions and to ensure that those reforms are implemented."

The cocoa-, gold- and oil-exporting nation has outlined plans to trim a budget deficit which climbed to more than 12 percent of GDP last year, from a target of 6.7 percent. Its local cedi currency has fallen around 11 percent against the U.S. dollar since January.

Most shops in central Accra were shuttered and the streets quiet as many Ghanaians watched the verdict at home. Police had sealed off main streets leading to the court, where helicopters hovered overhead, part of a deployment of 30,000 officers nationwide in case of any violence.

Ghana's $39 billion economy has been powering ahead, growing 8 percent last year, after oil production began at Tullow's Jubilee field in 2010.

However, some analysts said investors' attention would now shift back to the government's efforts to trim a budget deficit which climbed to more than 12 percent of GDP last year.

"Although an important element of uncertainty has been removed with the court verdict, it is unlikely that we will see a significant market impact," said Razia Khan, Africa analyst at Standard Chartered bank. "Investors will pay careful attention to any measures aimed at achieving fiscal consolidation."