In a televised statement he said he was quitting with immediate effect but said he disagreed with his ANC party’s decision.
The ANC had told him to step down or face a vote of no confidence in parliament.
The 75-year-old has been facing calls to give way to Deputy President Cyril Ramaphosa, the ANC’s new leader.
Mr Zuma, who has been in power since 2009, faces numerous allegations of corruption.
Earlier on Wednesday, police swooped on the Johannesburg home of the powerful and wealthy Gupta family with whom Mr Zuma has close ties.
He began his speech by laughing and joking with members of the press, asking them why they looked so serious.
After paying tribute to those whom he had worked with over the years, Mr Zuma said that violence and division within the ANC had influenced his decision to step down.
“No life should be lost in my name and also the ANC should never be divided in my name. I have therefore come to the decision to resign as president of the republic with immediate effect,” he said.
“Even though I disagree with the decision of the leadership of my organisation, I have always been a disciplined member of the ANC.
“As I leave I will continue to serve the people of South Africa as well as the ANC, the organisation I have served… all of my life.”
The resignation of president Jacob Zuma marks the end of an era. An era of one corruption allegation after another. An era of divisions, infighting and public squabbles. There are many people who are celebrating now, and not just from the opposition benches.
Some of President Zuma’s fiercest political foes came from his own ANC party. Comrades who fought white minority rule in the same trenches as he did, could not wait to see his back. He is gone now.
There is a renewed sense of hope as Cyril Ramaphosa is taking over the reins of Africa’s most industrialised economy. Some will miss him though, pointing to achievements like announcing free fees for higher education.
The ANC’s Jesse Duarte summed up the mood for many supporters of Mr Zuma’s when she said “this is a very painful moment”. (Courtesy BBC)