Governing party candidate Nana Akufo-Addo won 49.13% of the vote, against 47.92% for his rival, John Atta Mills, the commission said.
But neither reached the 50% threshold needed for an outright win and a run-off will be held on 28 December.
Local and international observers have praised Ghana for setting a good example on how to conduct an election.
Electoral commission chairman Kwadwo Afari Gyan told a news conference in the capital, Accra: "There is going to be a re-run and it will be between the two leading candidates."
The commission chairman did not immediately announce the results of the parallel parliamentary elections also held on Sunday, saying the commission needed to clarify some issues.
I am a little bit surprised because I thought it would be a straight victory
Moses, a voter in Kumasi
Ghana voters' reaction
"There are some disputes and claims," he was quoted by Reuters news agency as saying.
In the last parliament the governing New Patriotic Party (NPP) had a clear majority, but partial official results showed the opposition National Democratic Congress (NDC) closing the gap.
Turnout was 69.52% for Ghana's nail-biting fifth set of elections since it embraced multi-party democracy in 1992.
The BBC's Will Ross in Accra says after winning praise for its peaceful poll Ghana will now have to do it again, but the stakes are high, he adds, as the country has just discovered oil.
GHANA POLL IN NUMBERS
Eight candidates ran to succeed President John Kufuor
Ruling NPP party's Nana Akufo-Addo first with 49%
Opposition NDC's John Atta Mills second with 48%
Neither reaches 50% needed for outright win; run-off on 28 Dec
Turnout 70%; 8.6m votes cast; more than 200,000 rejected
Fifth elections since advent of multi-party democracy in 1992
Can Ghana trounce the bad news?
In pictures: Ghana votes
Analysts say the Ghana polls so far have shown African states can hold credible ballots, after violence and claims of fraud this year overshadowed elections in Kenya, Zimbabwe and Nigeria.
There were eight candidates in total to succeed President John Kufuor - who steps down in January having served the maximum two terms - but the election has been a two-horse race.
NPP candidate Mr Akufo-Addo won 4,159,439 votes, while NDC contender John Atta Mills had 4,056,634 ballots, it was announced.
Trailing a very distant third was businessman Papa Kwesi Nduom, of the Convention People's Party (CPP), with 1.3% of the ballot.
But correspondents have said the real third place went to spoiled ballots - out of the 8.6m votes cast, more than 200,000, or 2.4% of the total, were rejected.
The ex-British colony and nation of 22 million people was the first African state to gain its independence in 1957.
Regarded by investors as one of Africa's most promising emerging markets, it is the world's second biggest cocoa grower and Africa's number two gold miner.