Jacob Zuma has been re-elected as leader of South Africa's governing African National Congress.
He received an overwhelming majority of votes cast by some 4,000 delegates at the party's Mangaung conference.
Kgalema Motlanthe has been replaced as deputy president by anti-apartheid veteran Cyril Ramaphosa.
Mr Zuma had been favourite to secure the leadership after he was challenged for the top job by his deputy, Mr Motlanthe.
The 70-year-old won 2,986 votes out of the 3,977 cast - making it a decisive victory against his rival.
"We can boast that we're a leader of our society, that therefore we have something to contribute to the democratic life of this country, to this democratic Republic of South Africa," Mr Zuma said after his win.
He stepped on to the stage beaming to shake hands with fellow ANC members.
"We are certain that at this course in our democracy we are correct, that what we do at all material times, it is in the interest, not just of our organisation, but of our country and its people," he said.
The ANC, which has governed South Africa since white minority rule ended in 1994, is widely expected to win nationwide elections due in 2014. Mr Zuma is therefore likely to remain president until 2019.
There were deafening sounds of vuvuzelas, huge applause and singing as the results of the election were announced, the BBC's Milton Nkosi reports from the conference.
More than 4,000 ANC delegates crammed into the marquee, erupting into cheers as Mr Zuma's win became clear.
His decision to run as Mr Zuma's deputy has been seen by analysts as a way of shoring up the president's flagging support.
"With a man like Cyril, our country is going to be booming. Our economy is going to be tops," ANC delegate Peter Rankoe told Reuters.
Mr Zuma has been accused of failing to reduce poverty or tackle corruption within the ANC and government, while in August there was widespread shock when police shot dead 34 striking miners in the most deadly police action since the end of apartheid.
The country's former President FW De Klerk has told the BBC that a significant proportion of the South African population were unhappy with Mr Zuma.
"If the head of state loses the respect, I think that person loses the capacity to govern effectively. I think it would be in the best interest of South Africa if there can be a change of leadership in the ANC," he said.
Though he has also been dogged by personal scandals, his popularity within Nelson Mandela's ANC is overwhelming.
"I don't care what people say about Jacob Zuma," another ANC delegate, Sinovuyu Kley, said. "When you hear him sing, you know he is one with the people. He speaks our language and knows our struggles."
It is less clear where the results leave Mr Motlanthe, who ended months of speculation by announcing his decision to run against Mr Zuma for the leadership and declining to stand again as deputy leader.
Meanwhile, four white men have appeared in court accused of being part of a right-wing extremist plot to bomb the ANC conference.
The men were arrested on Monday in raids across the country and reportedly face treason and terrorism charges.
One was apprehended by police at a guesthouse in Mangaung, police said, according to the Associated Press.