JOHANNESBURG, May 31 (Reuters) -

For the first time in South Africa's democratic era, the African National Congress (ANC) will have to seek a coalition partner to govern with after it was on course to fall

well short of a majority

in the national election.

Here are scenarios of what could happen next in South Africa and which parties the ANC might partner with:

WILL RAMAPHOSA GET OUSTED?

With results in from over 60% of polling stations, the ANC had just under 42% of votes, by far its worst result since democratic elections began after the end of apartheid in 1994 and leaving it short of a majority in parliament.

Some political analysts say this could lead to party leader and South Africa's President Cyril Ramaphosa having to step down.

Over the past four electoral cycles the ANC's share of the vote gradually dropped, but never by more than five percentage points from one election to the next.

If the vote share of 42% or below is confirmed, the party could seek to oust Ramaphosa as its leader and nominate another high-profile politician such as Deputy President Paul Mashatile or Gwede Mantashe, currently in charge of the mines and energy ministry, to the National Assembly to elect as South African president. A more probable scenario could see Ramaphosa carry on for a while to broker a coalition deal with another party in a bid to secure a parliamentary majority and then hand over to a successor, analysts say. Asked on Friday whether Ramaphosa would have to resign after the dismal election result, ANC First Deputy Secretary-General Nomvula Mokonyane said: "Nobody is going to resign."

In any case, the ANC needs to move quickly as the constitution says the new National Assembly must convene within 14 days of the election results being declared, which is due to happen on Sunday, to elect a new president.

WHO ARE THE POTENTIAL COALITION PARTNERS? Depending on the final numbers, the ANC may have no choice but to seek support from one of its larger rivals: the pro-business, white-led Democratic Alliance (DA), uMkhonto we Sizwe (MK), led by former president Jacob Zuma, or the Marxist Economic Freedom Fighters (EFF).

The price of a deal with either of those would likely be significant policy concessions by the ANC, as well as the offer of some senior government positions for their partner.

Analysts say it is difficult to envisage a stable arrangement under this scenario, and South Africa could be facing a period of unprecedented government volatility. Investors and the business community would prefer a deal with the DA, which has received 23% of votes counted so far, and is seen as more market-friendly.

However, many analysts think the ideological divide between the ANC and the leading opposition party is so wide as to make such a deal difficult, if not impossible.

Led by Julius Malema, a former leader of the ANC's youth wing, the EFF may be a more natural fit for the ANC, but relations are tense between Malema and some ANC factions. The EFF, on 9.5% of the vote, said in April it would partner with the ANC if it got the powerful post of finance minister. The ANC, which has not disclosed its thinking on any non-majority scenario, would be unlikely to agree to this unless it were hugely weakened.

Steven Friedman, an academic affiliated with the University of Johannesburg and Rhodes University, said it was hard to imagine the ANC and the EFF governing together for five years.

He cited their inability last year to agree on a constitutional change on land reform even though their positions on the issue are closely aligned. A deal with the MK, currently emerging as the third biggest party with around 12%, would also be difficult to digest for the ANC, which struggled to clean its reputation after the corruption scandals of the Zuma era.

"What we do know now is that the ANC is in a trilemma," said Sizwe Mpofu-Walsh, a political analyst at the University of the Witwatersrand in Johannesburg.

"The ANC will have to decide whether it goes with its historical partners, the EFF and MK, or whether it takes an unprecedented step of reaching across the aisle of South African politics in a grand coalition with the DA.

"Anyone of those coalitions is politically unprecedented," he said. "It remains to be seen to what extent that represents a true policy shift in South Africa."

LESS LIKELY SCENARIOS If the ANC gets a last-minute boost to secure over 45% of the vote, which looks out of reach at this stage, it could try to make a deal with small- or medium-sized parties to form a government.

Analysts have said the socially conservative Inkatha Freedom Party (IFP), which is strong in KwaZulu-Natal province and is polling at about 3% nationally, could be the ANC's first choice, but its support would be insufficient to secure a majority. (Additional reporting by Nellie Peyton; Editing by Silvia Aloisi and Toby Chopra)