MARIKANA, South Africa — Voters cast ballots across South Africa on Wednesday after a long campaign season that betrayed the governing African National Congress party’s internal cracks, highlighted President Jacob Zuma’s deepening unpopularity and hinted at a realignment of the nation’s politics in the years ahead.

Hours before voting began at 7 a.m., South Africans lined up by the hundreds at polling stations, less to choose from a long list of parties than to pronounce judgment on the A.N.C., the liberation movement that has governed since the end of apartheid in 1994 but has become mired in corruption scandals in recent years. If the polls prove correct, the A.N.C. will steamroll to another victory, though with fewer votes than in the past.

Here in Marikana, a platinum mining town where the police killed 34 striking miners in 2012 in the most brutal display of force by the authorities in the post-apartheid era, voters began lining up at 2 a.m. at the Marikana Combined School. By 7 a.m., the queue stretched out of the school grounds and snaked around a column of trees; most of the voters, some wearing sweaters and wool hats in the autumn chill, live in a nearby squatters’ camp of tin shacks.

Last week, Mr. Zuma canceled a planned visit here at the last minute, a few days after protesters angry at the government’s handling of the strike and its aftermath burned down an A.N.C. office. Many voters expressed dislike of the president but said they could not turn against the A.N.C., underscoring the party’s continuing strength even in places with the most disaffected residents.