He said that intimidation had stopped his party, the ruling New Patriotic Party, from campaigning freely.
Mr Atta Mills has said he will be "a president for all".
Officials say there was no evidence of vote-rigging.
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.
'No evidence of fraud'
Electoral officials announced the result after the last constituency to vote, Tain, showed him extending his lead over Mr Akufo-Addo.
Street celebrations in Accra
The ruling party had boycotted the Tain constituency vote.
The electoral commission said the results of the run-off showed Mr Atta Mills had won narrowly with 50.23% of the votes, against 49.77% for Mr Akufo-Addo.
"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.
'Good fight'
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 was quoted by Reuters news agency as saying: "I acknowledge the electoral commissioner's declaration and congratulate Professor Mills."
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.
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.
Bookmark with:
What are these?