South African President Jacob Zuma's days as head of state appear numbered after his own party resolved to remove him from office at a marathon meeting that ended early on Tuesday morning.
The ruling African National Congress's (ANC) legal authority to remove a sitting president has not been tested, but analysts say Zuma might leave office before the end of the month.
Below are three possible scenarios for Zuma's departure.
The 75-year-old Zuma could follow the ANC's instructions and tender his resignation in a letter to the speaker of parliament, Baleka Mbete. This is how former president Thabo Mbeki left office in 2008 after Zuma replaced him as ANC leader.
If Zuma resigns, Deputy President Cyril Ramaphosa would become acting president. Ramaphosa would still be entitled to a maximum of two full presidential terms after completing the remainder of Zuma's second term, which runs until the middle of next year.
Within 30 days of Zuma's resignation, South Africa's chief justice would determine a date for the lower house of parliament, the National Assembly, to elect a new president from its members. If there is more than one candidate, this will be done by secret ballot.
If Zuma refuses to resign, Ramaphosa's allies in the ANC's National Executive Committee (NEC) have said they will push for a no-confidence vote in parliament, which would require a simple majority to pass.
Zuma has survived several such votes in the past, but on those occasions he could count on loyal voting from ANC lawmakers, who form the majority in the assembly. In the last no-confidence motion in August, Zuma only survived by a tight margin of 198 votes to 177. Since then he has lost the support of a number of prominent allies in the party.
Zuma also faces a Feb. 22 no-confidence vote tabled by the Economic Freedom Fighters, an ultra-left opposition party, though analysts say the ANC would prefer to oust Zuma via its own motion of no-confidence.
If Zuma is removed via a no-confidence vote, then the deputy president and cabinet would also be removed. The speaker of parliament would assume the role of interim president until the National Assembly elects a new leader to see out Zuma's term.
Zuma could also be removed via impeachment proceedings. This would take much longer as parliament is currently drafting new impeachment rules.
Should Zuma remain in power long enough for impeachment proceedings to be launched, then he would risk losing presidential benefits, including his pension and state security.
Impeachment would depend on two-thirds majority support by the National Assembly.