"On the basis of the official results given, it is my duty to declare Professor John Evans Atta Mills the president-elect of the Republic of Ghana," the commission's head, Kwado Afari-Gyan, said in the capital, Accra.
He said the commission had considered allegations of vote-rigging by both sides but "did not find the evidence provided sufficient to invalidate the result".
Outgoing President John Kufuor earlier urged both candidates to respect the final result.
He appealed for calm and said any complaints of vote-rigging should be dealt with by the courts after the new president is expected to be sworn in on Wednesday.
Addressing jubilant supporters on the streets of Accra around the NDC headquarters, Mr Atta Mills, who had failed twice before to become president, said: "The time has come to work together to build a better Ghana.
"I assure Ghanaians that I will be president for all."
He also congratulated "all other contestants, especially Nana Akufo-Addo, for giving us a good fight."
Although Ghana remains a very divided nation when it comes to choosing a president, it has proved that democracy can work, BBC correspondent Will Ross in Accra says.
Mr Atta Mills, aged 64, is a former vice-president. He lost two previous elections to President Kufuor.
Mr Akufo-Addo, also 64, from the New Patriotic Party (NPP) won the first round of the presidential election but not by enough to avoid the run-off.
On Saturday, he told reporters: "I acknowledge the electoral commissioner's declaration and congratulate Professor Mills," Reuters news agency reported.
A spokesman later told the BBC that, contrary to earlier reports, he had not conceded defeat, and that the ruling party would go to court to contest the result.
Analysts says Ghana's poll could help salvage the tarnished image of constitutional democracy in Africa, after last year's flawed elections in Kenya and Zimbabwe and military coups in Mauritania and Guinea.
The stakes have been raised in these elections because Ghana has just found oil, which is expected to start generating revenue in 2010.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.