South Africa in post-Nelson Mandela elections
Huge numbers of South Africans have been voting in general elections as the country marks 20 years since the end of white-minority rule.
The African National Congress (ANC) is tipped to win, returning President Jacob Zuma for a second five-year term.
These are the first elections since the death in December of Nelson Mandela, the country's first black president.
Polls are now beginning to close as the last of the voters cast their ballots, with the full result due before Friday.
The ANC is expected to win more than 60% of the vote, although opinion polls show there is disaffection with the country's leadership.
But it is not clear whether this will translate into a significant swing for the opposition.
Snaking queues line the narrow, dusty streets of Diepsloot, a densely populated township north of Johannesburg. Residents here frequently protest to demand basic services such as clean water, housing and electricity.
Albert Khosa, 73, escorted by his grandson said: "We've been starved of this vote for so many years. If I didn't vote today, I would feel empty."
His grandson Alpheos Tshikopo, 44, believes voting can make a difference: "We live in hope that things will change, that is why I am here today. If we have jobs we can look after ourselves, that is all we want."
It is a community of government-built houses and rusty shacks, old tarred roads leading to back roads with free-flowing sewage.
But today this township's problems seem to be forgotten as many are in high spirits, laughter and chatter in the long queues.
They are not throwing stones or burning homes owned by suspected criminals - instead they are waiting for hours in the scorching heat to make their voices heard in another way - at the ballot box.
The ANC's main challenger is expected to be the Democratic Alliance (DA), the liberal pro-business party led by anti-apartheid activist Helen Zille, which is trying to make inroads into the black electorate.
The Economic Freedom Fighters (EFF), launched last year by former ANC youth leader Julius Malema, hopes to get its first parliamentary seats with its campaign for nationalising the mines and the forced redistribution of farmland.Hoping for change
Those born after the end of apartheid in 1994 cast their first national ballots, although only a third of those entitled to do so had registered to vote.
Lehlohonolo Mafausu, 18, told the BBC she was very excited to be voting for the first time.
"Many people sacrificed their lives for me to get this chance," she said in Diepsloot, a township north of Johannesburg.
Police were deployed to areas where there had been scenes of violent protests and political tensions.
But correspondents said the voting began smoothly and there was an air of excitement, particularly among the first time voters.
The BBC's Milton Nkosi at a polling station in Soweto said voters had been walking in and out steadily making their mark.
One voter there told the BBC: "I don't see any party that can defeat the ANC. They fought for more than a hundred years... fought for this liberty and so no-one will turn their backs on them."
In Diepsloot, scene of frequent protests by people demanding basic services such as water and electricity, Alpheos Tshikopo, 44, said: "We live in hope that things will change - that is why I am here today. If we have jobs we can look after ourselves, that is all we want."
This concern was reflected in a BBC poll which suggests unemployment is the major issue for young voters in the country, where about a quarter of the workforce is jobless.
End Quote Ronnie Kasrils Former ANC minister
There's a rot that's set in, there's huge corruption and graft and cronyism”
The ANC's campaign drew heavily on its campaign to end apartheid and the outpouring of grief over Mr Mandela's death.
"Do it for Madiba, Vote ANC!" campaign posters read, referring to Mr Mandela by his clan name.
However, a group of former ANC stalwarts led by ex-Intelligence Minister Ronnie Kasrils called on people to choose one of the smaller opposition parties or spoil their ballots to remind the ANC "that they've got to serve the people of the country and not themselves".
"There's a rot that's set in, there's huge corruption and graft and cronyism," he told the BBC.
President Zuma urged people to cast their ballots freely as he voted in Nklandla near his rural home, which has been at the centre of scandal because of its expensive state-funded upgrades.
South Africa votes
- About 25 million registered voters - half the population
- Only a third of those born after 1994 have registered
- "Born-frees" make up 2.5% of voters
- 29 parties contesting national poll
- ANC defending 66% majority
- DA main challenger
- Julius Malema formed new left-wing party, EFF, last year
- About half the population lives on just over $2 (£1.5) a day; 10 million on less than $1
Source: IEC; IOL news site; government
Some 22,000 polling stations were open at schools, places of worship and hospitals, while dozens of vehicles serving as mobile voting centres operated in remote areas.
About 25 million people registered to vote - roughly half the population.
There was rioting in Bekkersdal township, south-west of Johannesburg, on Tuesday and some temporary polling stations were burned down.
Bekkersdal has suffered intermittent unrest since last year as residents protested over a lack of public services.