Votes are being counted in a leadership election for South Africa's ruling African National Congress (ANC), currently run by President Jacob Zuma.
About 5,000 delegates cast their votes in a bitterly fought race between Deputy President Cyril Ramaphosa and ex-minister Nkosazana Dlamini-Zuma.
Emotions have run high, with delegates shouting each other down as they raised objections over voting rules.
The ANC has governed South Africa since it attained democracy 23 years ago.
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.
How is the process going?
It has not been speedy. It had been hoped a result could come on Sunday but the voting only got under way in the early hours of Monday and went on through the night.
More than 4,700 delegates are at the four-day ANC elective conference at the Expo Centre in Johannesburg and they are not just voting for a leader, but for five other top posts.
Accusations of bogus delegates being given accreditation have not helped matters.
Nevertheless, the ANC was able to confirm at about midday local time (10:00 GMT) on Monday that voting had ended and counting had begun, with a result to be announced later in the day.
Who are the candidates?
He led the talks in the 1990s to end apartheid rule, before turning to a business career.
The 65-year-old has spoken out strongly against state corruption and for re-energising the economy.
For this, he has the backing of the business community.
Party chief whip Jackson Mthembu took to Twitter to say he had voted for Mr Ramaphosa,
Nkosazana Dlamini-Zuma, 68, is Mr Zuma's ex-wife and has his support.
A veteran politician, she has been critical of the enduring power of white-owned businesses and has vowed to tackle what she says is continuing racial inequality.
She served as Nelson Mandela's health minister, bringing in laws banning smoking in public areas, and later as foreign minister.
Police Minister Fikile Mbalula tweeted that he had voted for her.
Will it be close?
It would seem so.
Many are saying there could be just the smallest of margins between winning and losing, says the BBC's Lebo Diseko at the conference.
The leadership contest is also conducted in secret, and legal challenges are possible.
Early rumours of a modest Ramaphosa lead were quickly reflected by a rise in the financial markets.
But correspondents say there was a lot of singing in support of Ms Dlamini-Zuma on Sunday, and not much for Mr Ramaphosa.
Why does it matter so much?
Whoever wins would be a massive favourite for the 2019 presidential elections.
The outcome also matters hugely to the future of the ANC.
Mr Zuma, who has been in power since 2009, has himself warned that the party is under threat and at a "crossroads".
In his final speech as party leader at Saturday's conference opening, Mr Zuma denounced the party's "petty squabbling" during the leadership battle.
The party has overwhelmingly won every election since the country moved to democracy in 1994 under Mr Mandela.
But Mr Zuma said last year's disappointing results in local elections, when it polled only 54%, "were a stark reminder that our people are not happy with the state of the ANC".
The BBC's Andrew Harding says a question remains whether the party is in terminal decline, and what that might mean for South Africa's stability and its future.