Jacob Zuma is officially sworn in as an MP and elected leader
The leader of South Africa's African National Congress, Jacob Zuma, has been officially elected the country's president by members of parliament.
He will be inaugurated on Saturday. The ANC won the general election in South Africa two weeks ago.
Mr Zuma said it was an emotional moment to be returning to parliament after his ignominious departure in 2005.
He was fired as vice-president after being implicated in a graft scandal. Subsequent charges were dropped.
Mr Zuma has always denied any wrongdoing.
The charges were dropped just before last month's election - amid evidence of government meddling in pursuing the case.
In February 2006, the controversial polygamist was acquitted of rape in a separate case, though he was widely criticised for his comments about sex and HIV/Aids.
Mr Zuma, 67, was challenged in the vote by Mvume Dandala of the opposition Congress of the People (Cope), which broke away from the ANC last year.
We must move quickly... to protect jobs and boost the economy
Mr Zuma received 277 votes compared to 47 for Mr Dandala.
South Africa's fourth democratic parliament, seated in Cape Town, began by swearing in 400 MPs when it convened for the first time on Wednesday.
Before the vote for president, a member of one of the country's best known political dynasties, Max Sisulu, was chosen as the new speaker of parliament. His father, the late Walter Sisulu, was a lifelong friend of Nelson Mandela.
The BBC's Mohammed Allie in Cape Town says after winning the vote, Mr Zuma set out his five priorities:
Lowering crime levels
Finding decent work for all South Africans.
He said he would take a more hands-on approach and work more closely with the opposition.
"We must move quickly to implement the framework agreed by the government, business and labour to protect jobs and boost the economy," Reuters news agency quoted Mr Zuma as saying.
Tens of thousands of people and some 5,000 dignitaries are expected on Saturday to attend what is considered to be the main event: Mr Zuma's inauguration in Pretoria. His new cabinet will be announced by Sunday.
Mr Zuma won over voters on a pro-poor populist ticket and the ANC gained 264 seats in parliament.
But the party which has governed South Africa since the end of apartheid in 1994 fell just short of its previous two-thirds majority, which had enabled it to pass constitutional changes.
It lost ground to the official opposition, the Democratic Alliance, which has swelled to 67 seats and Cope (third place with 30 seats).
Our correspondent says former President Thabo Mbeki was criticised for not spending enough time in parliament but many analysts believe Mr Zuma will have a different approach.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.