At stake was the top job in a nation with a booming economy fuelled by a new and expanding oil industry. Ghana is also seeking to further burnish its credentials as a stable democracy in turbulent West Africa.
Privately owned Joy News television, based on provisional results from 267 of 275 districts, said Mahama had 50.60% and main rival Nana Akufo-Addo 47.82%.
The station added that "Mahama is the likely president-elect of Ghana" but the electoral commission had not made any declaration.
It based its finding on trends of already tallied votes in addition to an analysis of outstanding districts, it said. It also reported that turnout was at 81%.
Mahama, only in power since the death of his predecessor in July, told journalists on Sunday his team had "a fair idea" of the results based on its own tallies, but would wait for the electoral commission to make an announcement.
"We all will await peacefully the [commission's] verdict and we will abide by whatever verdict the electoral commission gives," he said during a courtesy visit by Nigerian ex-president Olusegun Obasanjo, the head of a regional observer team.
Akufo-Addo had not spoken publicly, but the general secretary of his NPP party claimed late on Saturday he was headed for victory. A party spokesperson offered a slightly different prediction on Sunday, adding he did not accept Joy's tally.
"It is looking like a run-off," said Perry Okudzeto, deputy director of communications for the party. "What is happening is that media are putting out figures which suggest that one side is headed for a win."
There were a total of eight presidential candidates. A run-off vote will be held on December 28 if no candidate receives more than 50%.
Mahama (54) of the National Democratic Congress, who took over after John Atta Mills died earlier this year. The writer and Afrobeat music fan from the country's north is seen as a fresh face in Ghanaian politics.
The 68-year-old Akufo-Addo of the New Patriotic Party, a UK-trained human rights lawyer and son of a former president, lost by less than one percentage point in 2008.
He is well-known to Ghanaian voters and has gained fame for his battles against past dictatorships, including political organising and fighting human rights cases in court.
Some analysts say the parties do not have major ideological differences, but the ruling NDC is seen as slightly centre-left while the NPP is viewed as more free market-oriented.
Ghana's presidential and parliamentary polls were held on Friday, but polling stations in some areas re-opened on Saturday after problems with a new biometric system and late delivery of materials led to delays.
Elections since the return to civilian rule in 1992 have seen both parties voted out of office, establishing Ghana's democratic credentials in a region that has seen its share of rigged polls and coups.
Ghana is also a top exporter of cocoa and gold, with economic growth of 14% in 2011. Eight percent growth is expected for 2012 and 2013.
How to spend the money?
How to spend Ghana's newfound oil money has been a key issue. Mahama has advocated a large investment in infrastructure, while Akufo-Addo has promoted his signature policy of free secondary education.
Observers from the Economic Community of West African States (Ecowas), a 15-nation regional body, said Saturday that "in the main, the electoral process was peaceful and transparent."
On the first day of the election on Friday, voting went smoothly in many areas, but a new biometric system requiring electronic fingerprints broke down in certain districts, resulting in long lines and frustration.
Materials arriving late also caused some polling stations to open far behind schedule.
In areas affected by the two issues, election officials ordered polling stations to extend voting into a second day in the country of some 24-million people.
Saturday was largely calm, but in the afternoon authorities fired tear gas to disperse a crowd of more than 100 people who burnt rubbish in the streets of a neighbourhood in the capital Accra.
The protesters were angry over rumours of vote-rigging. No evidence of rigging has emerged.
Ghana has had five elections since military rule ended in 1992, but the stakes are seen as higher this time, as commercial oil production that began in 2010 is set to expand. – AFP