South Africans voted Wednesday at schools, community centers, and in large white tents set up in open fields in an election seen as their country’s most important since apartheid ended 30 years ago. It could put the young democracy into unknown territory.

At stake is the three-decade dominance of the African National Congress party, which led South Africa out of apartheid’s brutal white minority rule and to democracy in 1994. It is now the target of a new generation of discontent in a country of 62 million people — half of whom are estimated to be living in poverty.

HOW SOUTH AFRICA’S FORMER LEADER ZUMA TURNED ON HIS ALLIES AND BECAME A SURPRISE ELECTION FOE

After casting his vote, President Cyril Ramaphosa said that he had no doubt his ANC would win again with “a firm majority.”

The main opposition leader, John Steenhuisen, countered: “For the first time in 30 years, there is now a path to victory for the opposition.”

The election was held on one day and polls closed after 14 hours of voting at more than 23,000 stations across South Africa’s nine provinces. Counting will start but final results are not expected for days. The independent electoral commission that runs the election said they would be announced by Sunday.

The ANC has seen its support slide in previous elections as Africa’s most advanced economy faces some of the world’s deepest socioeconomic problems. It has one of the worst unemployment rates at 32% and the lingering inequality, with poverty disproportionately affecting the Black majority, now threatens to unseat the party that promised to end it by bringing down apartheid under the slogan of a better life for all.

“Our main issue here in our community is the lack of jobs,” said Samuel Ratshalingwa, who was near the front of the line at the same school in the Johannesburg township of Soweto where Ramaphosa voted. He came out well before polls opened at 7 a.m. on a chilly winter morning.

“We have to use the vote to make our voices heard about this problem,” Ratshalingwa said.

After winning six successive national elections, several opinion polls have put the ANC’s support at less than 50% before this vote, an unprecedented drop. It might lose its majority in Parliament for the first time, although it’s widely expected to hold the most seats.

The ANC won 57.5% of the vote in the last national election in 2019, its worst result to date and down from a high of nearly 70% in 2004. That loss of support has been attributed to the widespread poverty, but also ANC corruption scandals, high crime rates and a failure of basic government services that see many communities go without running water, electricity or proper housing. Some voting stations were even impacted by electricity blackouts, officials said.

Ramaphosa, the leader of the ANC, has promised to “do better.”

The 71-year-old Ramaphosa sat alongside other voters in Soweto, where he was born and which was once the center of the resistance to apartheid. He shook hands with two smiling officials who registered him before voting.

“I have no doubt whatsoever in my heart of hearts that the people will once again invest confidence in the African National Congress to continue to lead this country,” Ramaphosa said.

Any change in the ANC’s hold on power could be monumental for South Africa. If it does lose its majority, the ANC will likely face the prospect of a coalition with others to stay in government and keep Ramaphosa as president for a second term. The ANC having to co-govern has never happened before.

South Africans vote for parties, not directly for their president. The parties then get seats in Parliament according to their share of the vote and lawmakers elect the president. Nearly 28 million people were registered to vote and the electoral commission said early indications were that it was a high turnout. Long queues remained into the night at some voting stations — people would be allowed to vote if they were in the queue before the closing time of 9 p.m.

The opposition to the ANC is fierce, but fragmented. The two biggest opposition parties, the centrist Democratic Alliance and the far-left Economic Freedom Fighters, are not expected to increase their vote by anything near enough to overtake the ANC.

That’s largely because disgruntled South Africans are moving to an array of opposition parties; more than 50 will contest the national election, many of them new. One is led by South Africa’s former President Jacob Zuma, who has turned against his former ANC allies.

Steenhuisen, the leader of the main opposition Democratic Alliance, said South Africa was now heading to “coalition country.” He conceded his party probably wouldn’t gain a majority, but put faith in a preelection agreement with other smaller parties to combine their vote to remove the ANC.

“I don’t think we’re going to solve the problems of South Africa by keeping the same people around the same table making the same bad decisions for the same bad results,” Steenhuisen said.

The ANC says it’s confident of retaining its majority and analysts haven’t ruled that out, given the party’s unmatched grassroots campaigning machine. It still has wide support.

“I woke up at 4 a.m. this morning, took a bath and made my way,” said 68-year-old Velaphi Banda, adding that he has voted for the ANC since 1994 and would do so again. “I was never undecided about which party I will vote for. I have always known.”

Ramaphosa has pointed out how South Africa is a far better country now than under apartheid, when Black people were barred from voting, weren’t allowed to move around freely, had to live in certain areas and were oppressed in every way. This election is only South Africa’s seventh national vote in which people of all races are allowed to take part.

Memories of that era of apartheid, and the defining election that ended it in 1994, still frame much of everyday South Africa. But fewer remember it as time goes on, and this election might give voice to a new generation.

“I feel like there are just no opportunities for young people in this area,” said 27-year-old Innocentia Zitha of her neighborhood.

While 80% of South Africans are Black, it’s a multiracial country with significant populations of white people, those of Indian descent, those with biracial heritage and others. There are 12 official languages.

The vote will also showcase the country’s contradictions, from the economic hub of Johannesburg — labeled Africa’s richest city — to the picturesque tourist destination of Cape Town, to the informal settlements of shacks in their outskirts, and the more remote rural areas. In one of those in the eastern KwaZulu-Natal province, 72-year-old grandmother Thembekile Ngema and others walked 20 minutes over rolling hills to get to their polling station.

South Africa has held peaceful and credible elections since a violent buildup to the pivotal 1994 election but nearly 3,000 soldiers were deployed across the country to ensure everything is orderly, authorities said.