Voting has officially closed across South Africa in the country's sixth general elections since the abolishment of apartheid 25 years ago.
Now counting takes place within the voting stations in front of party agents and observers.
Here's how the vote counting works:
The first step in the process is to check the seals and open the ballot boxes. The ballots contained therein are then reconciled with those issued, any remaining unused ballots and any ballots which may have been cancelled. Ballot boxes containing special votes are also opened and the contents verified against lists of authorised special voters before being added to the count.
Once the reconciliation is completed, the marked ballots are sorted into piles according to the party voted for. For ease of counting, the ballots are grouped together in batches of tens and hundreds.
Where the choice of the voter cannot be immediately and easily determined, these ballots are set aside for further scrutiny. Where the intention of the voter is then determined the ballots are added to those party piles.
Where the intention of the voter cannot be reasonably determined – or where the ballot is obviously spoiled – these are grouped together as spoiled ballots. The Presiding Officer makes the final determination of this.
The ballots for each party are counted and recounted to ensure accuracy and the results captured on two duplicate results slips which reflect the voting station, the number of cast ballots, the number of votes for each party and the number of spoiled ballots.
The results slips are signed by party agents present who are also encouraged to record the details of the results for themselves (including by taking a photograph of the results slip). One result slip is then posted on the door of the voting station while the other is taken by the Presiding Officer to the local IEC office where it is scanned and the data entered into the results system using a double capture system to minimize any human error.
Once audited by independent auditors, the results are released and are simultaneously visible to all those with access to the results system – including Electoral Commission, political parties, observers and the media.
Parties can verify the captured results against their copy of the original results slip to ensure accuracy. The length of the process depends on a range of factors including the number of votes cast at the voting station, the number of political parties contesting the ballots, and the number of clearly marked or unclearly marked ballots.
The conditions of the voting station – including whether it is a tent or permanent structure and the quality of the lighting and facilities also greatly affect the length of the process.
Once the final results are posted, all materials from the voting station are packed and transported under secure transport to capture sites where they are logged and stored. By law all ballots must be securely retained for six months in case of objections.
The first results from voting districts with the smallest number of voters are expected to reflect on the results system before midnight tonight.
A few not-so-minor hiccups have marred a remarkably smooth election. Earlier, the IEC reported that a total of five voting stations had not opened at all and in KwaZulu-Natal two voting stations were without electricity, forcing voters to make their mark in darkness.
Around the country a number of voting stations ran out of ballot papers and the IEC had to scramble to replenish their supplies.
The hiccups did not deter last-minute voters from braving the cold to cast their vote.
Results are expected to start trickling in late on Wednesday night, with the IEC saying that smaller voting stations could complete their counting by 11pm. However, the electoral body has previously said that they are aiming to have the full results by Saturday.