Thousands of delegates are voting in Johannesburg for a successor to President Jacob Zuma as leader of South Africa’s ruling African National Congress (ANC).
The vote began in the early hours of Monday and is still going on.
The choice is between Deputy President Cyril Ramaphosa and former cabinet minister Nkosazana Dlamini-Zuma.
Emotions have run high, with delegates shouting each other down as they raised objections over voting rules.
The eventual winner will be in a strong position to become national president after elections in 2019.
But the leadership battle has caused fierce political infighting, raising fears the party may split before then.
Mr Zuma has warned the party is under threat and is at a “crossroads”.
It has been in power since the country transitioned to democracy in 1994 under Nelson Mandela.
More than 5,000 delegates are taking part in the four-day ANC elective conference at the Expo Centre in Johannesburg.
Many there are saying there could be just the smallest of margins between winning and losing when the results come in, says the BBC’s Lebo Diseko at the conference.
The leadership contest is done in secret and is expected to be close, with legal challenges a possibility.
But proceedings were delayed as claims that bogus delegates had been accredited and real delegates barred were resolved.
A BBC correspondent there said voting was brought to a stop with what seemed like most of the room singing in support for Ms Dlamini-Zuma, who is President Zuma’s ex-wife. And unlike on Saturday, it was difficult to hear any counter singing in support of Mr Ramaphosa.
The party had said that anyone singing “divisive” songs would be thrown out, but there was little sign of that.
President Zuma, who has been in power since 2009, is expected to remain in power until the 2019 national elections. The country limits presidents to two five-year terms.
The 75-year-old has been at the heart of much of the controversy surrounding the ANC party. He currently faces numerous corruption allegations but denies any wrongdoing, having already survived several votes of no confidence in parliament during is presidency.
He is backing his 68-year-old former wife, Ms Dlamini-Zuma, a veteran politician in her own right, who has been critical of the enduring power of white-owned businesses. They have been divorced for almost 20 years and had four children together.
A former leader of the women’s wing of the ANC, Ms Dlamini-Zuma has served as foreign, home and health minister in government.
Her economic agenda is very different to main opponent, the country’s deputy president, Cyril Ramaphosa, who is one of the country’s wealthiest men and a former leading trade unionist.
Mr Ramaphosa, 65, has spoken out strongly against state corruption and has the backing of the business community.
Recent news that he had a modest lead in the polls was quickly reflected by a rise in the financial markets.
In his final speech as party leader at Saturday’s conference opening, Mr Zuma denounced the party’s “petty squabbling” during the leadership battle.
Last year’s disappointing results for the ANC in local elections, he said, “were a stark reminder that our people are not happy with the state of the ANC”.
In the speech he asserted that “theft and corruption” were as prominent in the private sector as they are in government. He added that “being black and successful is being made synonymous to being corrupt”.
He lashed out at the media, which he said was not “impartial and fair”. He also targeted the judiciary, arguing that the courts should have no role in deciding internal party matters.
The party has overwhelmingly won every victory since 1994, when democratic elections where everyone could vote brought the end to white-minority rule. But it polled only 54% in last year’s local elections, its worst result since taking power.
The BBC’s Andrew Harding says a question remains whether the ANC is in terminal decline, and what that might mean for South Africa’s stability and its future.