Ending a five-day conference where the ANC's rifts were on stark display, Ramaphosa said his first five years as party chief had been a "difficult journey."
"We have encountered many problems, at times we have met fierce resistance," he told an audience of more than 4,000 delegates.
"I see my task as uniting the ANC," he said.
Turning to the corruption which has deeply stained the party's image, he declared, "We either deal with this problem or we perish as an organisation."
Ramaphosa, 70, secured a second term at the helm of the ANC after a bruising race against his former health minister, Zweli Mkhize.
He is being probed by the police and other agencies over the way he handled a burglary at his farm.
He allegedly covered up the theft of $580,000 in cash that was hidden under sofa cushions instead of reporting the loss to the authorities.
Ramaphosa gained 2,476 votes against 1,897 votes for Mkhize -- a comfortable margin but one far smaller than would have been predicted only a few months ago.
The vote outcome should be embraced by all, as "it's the ANC that has spoken," he declared.
Ramaphosa's victory opens the way for him to a second term as South African president if the ANC win the next general elections, due in 2024. Under the constitution, the head of state is chosen by parliament.
But the ANC's continued majority in the National Assembly is in doubt, given a slump in support.
In the last local government elections, it won less than 50 percent of the votes cast, a first in a history spanning more than a century.