South African President Thabo Mbeki told the nation he's resigned, effective as soon as a new president is chosen.
Mbeki spoke in a nationally televised address on Sunday. A day earlier, his party, the African National Congress (ANC), had demanded his resignation. He will leave before his second term in office expires next year but he did not set a date.
Parliament will convene in the coming days to select an interim president to serve until elections, which are scheduled for next year. Baleka Mbete, the speaker of the National Assembly and chairwoman of the ANC, is expected to take over.
Mbeki lost the final battle on Saturday in a long struggle against his former deputy, Jacob Zuma. He came under pressure to quit after a judge threw out a corruption case against Zuma earlier this month and implied that Mbeki's administration had put political pressure on prosecutors.
Zuma will likely be the ANC's candidate for president next year, but he is not eligible to replace Mbeki now because he is not a member of Parliament.
In his address, Mbeki said "categorically" that he had never interfered in the work of prosecutors. He said that included "the painful matter" of the Zuma case.
The 66-year-old head of state looked sombre in the television address and his eyes glistened as he finished. He thanked South Africans for letting him serve in office and said he was confident the incoming administration would tackle poverty facing the country.
"We should never be despondent if the weather is bad, nor should we turn triumphant because the sun shines," he said.
A senior ANC official, Matthews Phosa, said the party had asked the cabinet to remain on the job. "We want the cabinet to stay," Phosa said. "We want stability and we want them to stay ... but we cannot enforce things upon them," he said.
Early indications were that most cabinet ministers had agreed to stay on rather than quit in solidarity with Mbeki. Finance Minister Trevor Manuel - important to investor confidence in South Africa - has said he will continue in the job.
ANC secretary-general Gwede Mantashe said on Saturday the party hoped to end its internal wrangling and focus on the elections. The ANC enjoys a huge majority and is expected to romp to victory. But there had been speculation that Mbeki loyalists might try to set up a rival party.
Although Mbeki's removal came more quickly than many people expected, South Africans had been anticipating a shift from Mbeki to Zuma at least since last December, when Zuma defeated the president in an election for the ANC leadership.
Mbeki fired Zuma as his national deputy president in 2005, after Zuma's financial adviser was convicted of trying to elicit a bribe to deflect investigations into the arms deal.
Initial charges against Zuma were withdrawn, but the chief prosecutor said last December he had enough evidence to bring new ones. A judge threw out the new charges last week and implied they were the result of political interference.