Jacob Zuma, South Africa's embattled and controversial president, has announced his resignation in a televised address to the nation.
"I have to come to decision to resign with immediate effect," he said late on Wednesday in Pretoria.
Zuma's resignation followed weeks of intense public pressure to step down amid longstanding corruption allegations.
The ruling African National Congress (ANC) formally asked Zuma, 75, to resign on Tuesday. He initially refused, saying he did not understand why he was being told to step down.
The party later announced plans to hold a no-confidence vote against him on Thursday in parliament.
"It is my party that placed me the representative of the people. It is my party that availed me," Zuma said in his speech from Union Buildings.
"Make no mistake, no leader should stay beyond the time the people they serve. No leader should seek an easy way out because they could face a life without the perks of political office."
Deputy President Cyril Ramaphosa, who is also the newly elected head of ANC, is expected to become acting president on Thursday.
A new president must be elected within 30 days but the cabinet and presidency continues.
Zuma, who served as the country's president since 2009, joined the ANC in 1958.
He is considered one of the party stalwarts, having served for 10 years on the Robben Island prison alongside freedom fighter Nelson Mandela and living in exile before returning to South Africa in 1990.
Despite being known for being an astute political operator, Zuma's presidency was characterised by scandal and corruption allegations, making him the most controversial president since the end of apartheid.
"South Africa will look back and wonder how we allowed a president so reprehensible to last so long in office," Sizwe Mpofu-Walsh, author of Democracy and Delusion: 10 Myths in South African Politics, told Al Jazeera.
South Africa's Constitutional Court ruled last December that parliament had failed to hold Zuma accountable over the alleged use of state funds to upgrade his rural home in Nkandla.
That followed an earlier court decision in April 2016 that found Zuma had "failed to uphold, defend and respect the Constitution".
It resulted in an impeachment vote that same month, but the motion failed to pass when parliament, where the ANC holds a majority, voted 233 to 143 in Zuma's favour.
Zuma was also found to have given favour to an Indian immigrant family known as the Guptas, in what became known as the state capture scandal.
It was reported that the family wielded such influence over Zuma that they were able to decide who got appointed to the cabinet.
Zuma has always claimed his innocence and some South Africans still defend him, saying he was targeted unfairly in a system that is underpinned by corruption.
"When it comes to the allegations of state capture, the state was captured a long time ago. And here we are focusing only on Zuma. There is a broader perspective one needs to take when looking at state capture," Wandile Giwa, a 26-year-old student, told Al Jazeera.
But most South Africans are expected to be overjoyed by Zuma's ouster.
The call for Zuma to step down reached a crescendo in early February when the Nelson Mandela Foundation released a statement calling for him to go immediately.
"President Zuma has abused the trust of South Africans. He must go, sooner rather than later. Time is of the essence," the foundation said.
The court rulings heightened pressure on Ramaphosa, who was elected ANC leader in December 2017, to force Zuma to step down as the party looks to repair its reputation.
But Zuma had survived several no-confidence votes in parliament and until early February believed he would survive another.
The tide changed, however, and several of his allies abandoned him.
Ramaphosa has been clear that he had no intention of humiliating Zuma and the ANC itself reportedly wanted him to bow out on his own, rather than drag out the process.
Still, Zuma leaves the ANC deeply divided and analysts say the party faces a serious challenge to repair its reputation in his wake.
"Ramaphosa will have a hard time fixing a party that faces indecision and disagreement over its values at every level," said Ebrahim Fakir, an independent political analyst.