CAPE TOWN, South Africa (AP) — South Africa held a national election Wednesday that could be the country's most hotly contested in 30 years, with the long-ruling African ºÚÁϳԹÏÍø Congress party facing a stern test to hold onto its majority.

The ANC has been the majority party and in government ever since the end of South Africa's and the establishment of democracy in 1994 and

Under the South African political system, people vote for parties and not directly for the president in their national elections. The two processes are separate, even though they are linked: to decide the makeup of Parliament and lawmakers then elect the president.

Here's a guide to the main election in and why it might be complicated this time for Parliament to choose the president.

ELECTION

The election took place on just one day, with polls opening at 7 a.m. and closing at 9 p.m. across the country of 62 million people, which has nine provinces. Nearly 28 million South Africans were registered to vote to of their national as well as provincial legislatures.

South Africans can choose parties, or for the first time independent candidates, to go to Parliament. according to their share of the vote.

Counting starts immediately after the polls close and the final results are expected by Sunday, according to the independent electoral commission that runs the election.

CHOOSING A PRESIDENT

The president is elected in Parliament after the national vote's results are announced. South Africa's Parliament has two houses and it's the lower house, or ºÚÁϳԹÏÍø Assembly, that chooses the president.

There, the 400 lawmakers vote for one of them to be the head of state and it needs a simple majority of 201. Because has always had a parliamentary majority since 1994, every president since then has been from the ANC, starting with Nelson Mandela.

WHY THIS YEAR COULD BE HISTORIC

It has been almost procedural over the last three decades for the ANC to use its parliamentary majority to elect its leader as president of the country. This year may not be so simple.

Several polls have the ANC's support at less than 50% ahead of the election, raising the possibility that . It is still widely expected to be the biggest party, but if it goes below 50% it would then need an agreement or coalition with another party or parties to stay in government and get the 201 votes it needs from lawmakers to reelect for a second and final five-year term.

The new Parliament must meet for its first session within 14 days of the election results being announced to choose the president. Should the ANC lose its majority, there would likely be a feverish period of bargaining between it and other parties to form some sort of coalition before Parliament sits.

It's possible that several opposition parties could join together to oust the ANC completely from government and Ramaphosa as president if they don't have a majority. That's a very remote possibility, though, considering the two biggest opposition parties — the and the — are as critical of each other as they are of the ANC and are seen as unlikely to work together. The DA is part of a pre-election agreement to join forces with other smaller parties, excluding the EFF, in a coalition but they would all have to increase their vote considerably to overtake the ANC.

The ANC has given no indication of who it might work with if South Africa needs an unprecedented national coalition government. Ramaphosa said Wednesday after voting that he was confident the ANC would win an outright majority.

___

AP Africa news:

ºÚÁϳԹÏÍø. All rights reserved.