JOHANNESBURG — Millions of South Africans cast ballots on Wednesday, voting for the first time since President Cyril Ramaphosa assumed power early last year with promises to renew both his corruption-ridden party and the beleaguered nation.

A quarter-century after the end of apartheid captured imaginations worldwide, Mr. Ramaphosa and his party, the African National Congress, faced an electorate increasingly disillusioned with the state of South Africa’s democracy. The vote is partly a referendum on Mr. Ramaphosa, whose personal popularity has consistently polled higher than his party’s.

Many of the A.N.C.’s traditional supporters approve of him, polls show. But they question whether he can outflank powerful party rivals and root out the endemic corruption that has come to define the A.N.C., Nelson Mandela’s once celebrated liberation movement.

“I got trust in Cyril Ramaphosa — he’s done a lot already against corruption,” Reckson Chauke, a 57-year-old steelworker, said after he voted for the A.N.C. in Alexandra, a black township in Johannesburg.