Supporters of Jacob Zuma have been celebrating his election as the new leader of South Africa's governing party, the African National Congress. Mr Zuma defeated President Thabo Mbeki after an acrimonious conference, during which Mr Mbeki was heckled.
As the celebrations got under way, both sides spoke of trying to heal the deep rifts in the party.
Mr Zuma is now in a strong position to become the country's next president when Mr Mbeki's term ends in 2009.
Of the 3,834 voting delegates, Mr Zuma received 2,329 to Mr Mbeki's 1,505.
Mr Zuma and his supporters also won a clean sweep of five other top positions in the ANC.
The BBC's Peter Biles at the conference says South Africa now has two centres of power - Mr Mbeki as president and Mr Zuma as head of the ruling party.
The announcement of the result was greeted with chants of "Zuma, Zuma".
Mr Mbeki embraced Mr Zuma and clasped his rival's hand in congratulation.
Our correspondent says the public show of unity was a powerful signal to the rank and file that they needed to heal the rift and get on with the business of running the country.
But the real question is whether Mr Zuma can deliver on that promise of unity and continuity, he adds.
Mr Zuma has already made it clear that there will be no change in ANC policy.
But while he is strongly placed to become the next national president, Mr Zuma could still face corruption charges in connection with a multi-million dollar arms deal.
Helen Zille, leader of the main opposition Democratic Alliance, called the vote a "dismal day" for the ANC and for South Africa.
"It is an indictment on the ruling party that they could find no better candidate than Jacob Zuma to lead them," she said.
Correspondents say it has been the most divisive contest in the long history of the ANC - for some this is a sign of a healthy democracy in action while others fear the split in the ANC could spell trouble for South Africa.
It was the ANC's first leadership contest in 58 years.
Delegates were warned to behave or face disciplinary action on Monday after rival supporters tried to out-sing each other amid chaotic scenes.
Mr Mbeki had said claims by the Zuma camp that he had centralised power were false. But growing unpopularity with Mr Mbeki's style of leadership had made Mr Zuma favourite.
Mr Zuma's supporters believe he will do more to reduce poverty in South Africa.
Once close allies, Mr Zuma and Mr Mbeki fell out in 2005 when Mr Zuma was sacked as deputy president over corruption allegations.
The case against Mr Zuma was thrown out by a judge last year. He was also acquitted of rape charges, which he said were politically motivated.
Before the vote, former President Nelson Mandela said he was saddened by "the nature of the differences currently in the organisation".
The former Archbishop of Cape Town, Desmond Tutu, said neither Mr Zuma or Mr Mbeki were suitable candidates.