Farooq Kotiya,BBC News, Johannesburg
The election, considered South Africa’s most hotly contested since the African National Congress (ANC) came to power 30 years ago, is now being counted.
Long lines formed outside polling stations across the country, winding into the night.
An electoral official in Johannesburg told the BBC that the queues were reminiscent of the historic 1994 election, when black people could vote for the first time and Nelson Mandela became president.
Thousands of people were still waiting to cast their votes when polls officially closed at 2100 local time (1900 GMT), but the electoral commission said they would all be allowed to vote.
The first results have been released, from just over 10% of the constituencies.
The ANC led with 42% of the vote, followed by the Democratic Alliance (DA) with 26% and the Electronic Freedom Front (EFF) with 8%, while former president Jacob Zuma The leading uMkhonto weSizwe Party (MK Party) received just under 8% of the vote.
Final results are expected over the weekend.
Opinion polls suggest the ANC may lose its parliamentary majority for the first time in 30 years, forcing it to form a coalition government.
The ANC has lost support amid anger over corruption, crime and high unemployment.
“Freedom is great, but we need to tackle corruption,” Sifiso Buthelezi, who cast her vote at Johannesburg’s Joubert Park, South Africa’s largest polling station, told the BBC.
Change has been a recurring sentiment, especially among younger voters.
Ayanda Hlekwane, a member of South Africa’s “born free” generation (those born after 1994), said that despite having three degrees, he is still unemployed.
“I’m working on my PhD application so I can go back to study in case I don’t find a job,” he told the BBC in Durban.
But Mr Hellekwane said he was optimistic things would change.
With a record 70 political parties and 11 independents running, South Africans voted for a new parliament and nine provincial legislatures.
Analysts said this showed that many people were disappointed with the ANC.
“We are entering the next phase of democracy, which is going to be a major shift,” political analyst Richard Callan told the BBC.
“Either we become a more competitive and mature democracy, or our politics will become more divided.”
The main opposition Democratic Alliance (DA) has signed an agreement with 10 other parties to form a coalition government if it gets enough votes to oust the ANC.
But this is highly unlikely, as the ANC is expected to remain the largest party and would be in pole position to lead a coalition government if its approval ratings did fall below 50%.
It received 57.5% of the vote at the last election, compared with 21% for the DA.
South Africans do not directly vote for president. Instead, they vote for legislators, who then elect the president.
Therefore, current President Cyril Ramaphosa is likely to remain in power.
Former President Jacob Zuma caused a huge shock when he announced in December last year that he would abandon the African National Congress and instead run for the new political party uMkhonto weSizwe (MK) (meaning “Spear of the Nation”).
Although he was barred from running for parliament due to a contempt of court conviction, his name still appeared on the ballot as MK leader.
MK is expected to perform particularly well in Mr Zuma’s home province of KwaZulu-Natal, where tensions have been high and some violence was reported during the campaign.
Police and troops have been deployed to polling stations across the country to ensure voting takes place peacefully and that votes are not stolen.
According to statistics released by the Election Commission, more than 27 million people are registered to vote, of which 55% are women.
In terms of age group, those aged 30 to 39 have the largest number of registered voters. They account for nearly 7 million of the 26.7 million voters.
Young people can make this election work in their favour.
Njabulo Hlophe, a 28-year-old artist, said that young people in South Africa are often marginalized, but “this is our country, just like our parents… they left it to us, so people who really care about young people It’s someone I’m really looking at.”
Support for the ANC is expected to be higher among older generations.
Elayne Dykman, an 89-year-old woman, told the BBC in Durban that she hoped young South Africans would not take their vote for granted.
Additional reporting by Anne Soy in Durban and Barbara Plett Usher in Soweto