JOHANNESBURG -- The vote to choose the next president of South Africa's ruling African National Congress party was set to get underway Sunday evening, after the party officially nominated two candidates to lead Nelson Mandela's historic liberation movement.

After a rocky start to the gathering, two candidates accepted the party's nomination for president on Sunday: Nkosazana Dlamini-Zuma, former African Union commission chair and Zuma's ex-wife, and Deputy President Cyril Ramaphosa, a wealthy businessman who has been increasingly critical of the president.

Ballots were being prepared and voting was expected to start in the evening and to go on late at night, possibly until Monday morning, an ANC official told the press.

The ANC's new leader is likely to become South Africa's next president. More than 4,700 ANC delegates have gathered on the outskirts of Johannesburg to vote for a new party leader as President Jacob Zuma's two terms as head of the party come to an end.

The nominees for deputy president are David Mabuza and Lindiwe Sisulu.

Though either presidential candidate could still prevail, Ramaphosa had the edge after the nominations were announced, with the backing of 1,469 ANC branches, compared to Dlamini-Zuma's 1,094. The Saturday night endorsement of Ramaphosa by Baleka Mbete, the party's outgoing national chairwoman and a Zuma ally, also fueled speculation that the race may be swinging in the deputy president's favour.

The mood at the party conclave, held once every five years, was jubilant on Saturday as delegates arrived at a conference centre in luxury buses, clad in the ANC's yellow and green colours. However disagreements quickly erupted over the legitimacy of some delegate groups. By midday Sunday, the credential process was resolved.

The ANC's reputation has taking a beating during Zuma's scandal-ridden tenure, causing rifts that threaten to split Africa's oldest liberation party. Keeping the ANC together has been a key talking point at the gathering.

"In all its manifestations, factionalism has become the biggest threat to the organization," Zuma said in a tepidly received speech at the opening of the conference. "Unity is what will make the ANC and South Africa succeed."

On Saturday, Zuma made a surprise announcement that the government would fully subsidize tertiary education for "poor and working class" students, despite findings of a government commission that South Africa cannot afford it. Some observers read the move as a last-minute push to help the campaign of Dlamini-Zuma.