South Africans vote in crucial local elections
South Africans have been voting in local elections after one of the most bitterly fought campaigns in years.
The delivery of basic services like water, housing and jobs have been among the issues dominating campaigning.
Long queues were seen in the most hotly contested areas, such as Johannesburg and Cape Town, with the vote said to be fairly smooth.
The ruling African National Congress (ANC) controls all of South Africa's nine provinces except the Western Cape.
Analysts say the ANC is likely to remain the largest party, but is facing its strongest opposition since the end of apartheid in 1994.
The BBC's Pumza Fihlani in Johannesburg says it is one of the most hotly contested local elections in recent years.
The battle for control of municipalities in the key economic provinces like the Western Cape, currently controlled by the opposition Democratic Alliance (DA), and Gauteng has seen mud-slinging from party officials and aggressive door-to-door campaigning by senior party officials to rarely visited parts of the country, she says.
Last week, President Jacob Zuma warned his countrymen that their ancestors would never forgive them if they voted against the ANC, which led the fight against white minority rule.
Protests threatened to disrupt elections in at least three of South Africa's poorest provinces - North West, Limpopo and Northern Cape.
Some communities there refused to vote and held demonstrations near polling stations, demanding that the government provide services such as running water, electricity and decent housing but the police were able to prevent any violence.
There was also a large police presence in Ficksburg in Free State province, where a man was allegedly shot dead by a group of officers during one such protest last month.
Some protesters say the services are not being delivered because of corruption by local ANC councillors, who face very little opposition in many parts of the country.
A row over uncovered toilets has become the latest symbol of these demands.
"We are living in a dirty place. I want our place to be nice, I am voting for change. There have been changes since 1994 but not enough," Adeline Ndlanzi, 58, told Reuters news agency as she waited to vote in the Soweto township near Johannesburg.
"I want to see more employment created in this country for everyone. I am hoping my vote with make the government do more for its people," Nonhlanhla Dlamini, 19, told the BBC's Network Africa's programme as she voted in Springs township, east of Johannesburg.
Some 23 million people are registered to vote. Results expected on Thursday or Friday.
In previous years, the DA has been seen mainly as a party for white people and those of mixed race but it has made a determined effort to appeal to the black majority in this election.
"This is the first election in which we've really seen a concerted attempt by the official opposition to compete for the black vote and the real test is whether black voters are biting," Steven Friedman from the Institute for Democracy in South Africa told the BBC's Focus on Africa programme.
"It's certainly a propitious time for the opposition - there's a lot of feeling by grassroots supporters of the ruling party that the political leadership are only interested in themselves and other politicians - that they're not interested in voters," he said.
He said the polls were important in terms of South Africa's maturing democracy.
"We're not really going to have an effective democracy in this country until politicians are more accountable to voters. If you have a ruling party which wins with thumping majorities every time, it's very difficult for there to be accountability," Mr Friedman said.
But correspondents say ANC supporters are fiercely loyal and though there may be disappointment, many voters may not yet feel ready to switch sides.
"It's a party which I like and where my home is. Today I feel liberated because of that party," Malixole Gobelo, 60, told the AFP news agency as he voted in Cape Town.
"I will support that party until I die."