Zuma railed against the African National Congress (ANC) for ârecallingâ him from office and threatening to oust him via a parliamentary no-confidence vote due on Thursday.
In a 30-minute national television address, Zuma said he had âcome to the decision to resign as president of the republic with immediate effectâ.
Ramaphosa, who won control of the ANC when he was elected as its head in December, is set to be voted in by lawmakers as South Africaâs new president on Thursday or Friday.
Zuma, whose reputation has been stained by years-long allegations of graft, complained that the ANC party had never explained to him why he had to leave office.
In an earlier TV interview on Wednesday, he said he had received âvery unfairâ treatment from the party he joined in 1959 and in which he had fought for decades against apartheid white-minority rule.
He said he was angered over âthe manner in which the decision is being implemented⊠I donât agree as there is no evidence of if I have done anything wrong.â
The partyâs national executive committee ordered his recall from office on Tuesday, after a 13-hour meeting at a hotel outside Pretoria.
ANC officials had said that if Zuma did not resign on Wednesday, the partyâs lawmakers in the Cape Town parliament would vote out Zuma on Thursday.
But senior party official Jesse Duarte said after the resignation that âwe are not celebratingâ.
On Wednesday morning, police had raided the Johannesburg home of the Gupta business family, which is accused of overseeing a web of corruption under Zumaâs rule.
Police said three unidentified people had been arrested in investigations into âVrede Farmâ â allegations that millions of dollars of public money meant for poor dairy farmers were syphoned off by the Guptas.
Local media reported that Zuma had been pushing for an exit deal that included covering his potentially ruinous legal fees fighting multiple criminal charges â but he denied the allegations in his resignation speech.
One case against him relates to 783 payments he allegedly received linked to an arms deal before he came to power.