Polls have closed in Sudan's first multi-party elections since 1986. The vote was part of a north-south peace deal which ended two decades of war which left some 1.5 million people dead.
However, a separate conflict is still under way in the western region of Darfur. BBC correspondents around the country sum up the scene on the final day of voting.
OMER MAHMOUD, KHARTOUM
Voting was slow by the fifth day of the ballot
Sudanese like to do things at the eleventh hour, said one electoral official who was expecting a last-minute rush of voters in the hours before polls closed.
But at the polling stations I visited in Khartoum North on Thursday morning, very few people were there to vote. The head of the polling centre in Khartoum Bahri said 85% of people had cast their votes, most on the first two days.
First multi-party polls in 24 years
Polls to elect president and 450-member national assembly, as well as governors and legislative bodies for 25 states
Complicated process, with some in the south having to cast 12 different votes
Several opposition parties have boycotted the polls, alleging fraud
Results due next week
Southern Sudan due to hold independence referendum in January 2011
In truth, the mood over the last five days in Khartoum has been somewhat lacklustre.
One young woman told me she was not sure whether to bother voting, as the result was a fait accompli.
She did cast her ballot in the end, but her hesitancy was echoed by others who said the race had already been won by President Omar al-Bashir as his two main opponents - Sadiq al-Mahdi of the Umma party and Yassir Arman of the Sudan People's Liberation Movement - withdrew from the presidential race citing fraud.
Opposition polling agents and local election observers have said the voting process itself has passed off smoothly.
Problems were evident on Sunday when, for example, people at a polling station in Imtidad Nasr were not able to vote until the afternoon as ballot papers had not arrived.
By day two, the election commission said these hiccups in the capital had been resolved and former US President Jimmy Carter said they did not seem to warrant a re-run of the vote.
However, in River Nile State, north of Khartoum, there are some areas where the polls have been postponed because of a problem with the printing of ballot papers.
On day four of polling, Mr Bashir offered to form a unity government with the opposition. So far Mr Mahdi has sat on the fence, saying he will think about it - but the Popular Congress Party of veteran Islamist Hassan al-Turabi has rejected the offer out of hand.
UDUAK AMIMO, JUBA
Voters in the south sometimes found it hard to find their names on the register
Text messages urging people to take advantage of the last day of voting were doing the rounds in Juba, as did a truck blaring the same message from loudspeakers.
Despite such calls, polling stations we drove by on Thursday seemed empty.
The city itself is coming back to life, with shops closed earlier in the week opening for business.
When the polls opened on Sunday, there was an air of excitement as many people were voting for their first time.
The enthusiasm was somewhat dampened by the ensuing confusion.
The heat added to the frustration as people found it hard to find their names on lists at polling stations.
There are high illiteracy levels here, which added to the difficulties, and the names were printed in English and Arabic but not listed in the same order.
One man I spoke to had searched for three days to find his name on the register, finally casting his vote at a polling station at the University of Juba on Tuesday.
Voting was extended by an extra two days, but by Wednesday it was rather sluggish.
There were concerns the landmark polls for the south would be marred by violence.
Opposition candidates have accused the Sudan People's Liberation Movement of harassment in several southern states, though these claims have been denied by the former rebels who are now the main party in the south.
On Wednesday, local observer group - the Sudanese Network for Democratic Elections - said in a statement that security personnel had removed its staff from some polling stations in Juba. Some of them had been detained and one assaulted by the police, it said.
The counting will start on Friday as, according to the electoral authorities, a lot of areas will not have electricity to work through the night.
JAMES COPNALL, FASHER
Not many people in Darfur's camps for the internally displaced registered to vote
A gaggle of women in brightly coloured robes walked through a small sandstorm, determined to cast their vote.
Their journey has been a long one - it is Sudan's first multi-party polls since 1984.
But more than that, these women have already been forced out of their homes by Darfur's civil war.
The polling station, at Salam 11 school, serves the inhabitants of the Abu Shouk internally displaced camp.
They may be a long way from home, and living in very basic conditions, but this election would not pass them by.
Here the concerns seemed very local, with more talk of the election for state governors than the presidential.
The fact that these women can vote at all already confounds those who said there could never be elections in Darfur.
At Salam 11, as elsewhere in Fasher, the vote passed off peacefully, albeit with a few logistical problems.
Some people did not find their names on the voting list, for example.
But the real story of Darfur's elections is perhaps elsewhere. In huge areas of Darfur controlled by rebels there was no voting at all.
The European Union Observer Mission pulled out its teams from Darfur, fearing both for the security of its monitors and that they wouldn't be able to observe freely.
Hundreds of thousands of people were disenfranchised too. In internally displaced people's camps like here in Abu Shouk, most people did not register.
Either they did not realise there were elections, or they were scared of the government, or the camp leaders told them not to.
So overall the elections in Darfur seem to have passed off well.
But the people most opposed to President Omar al-Bashir are the least likely to have voted.