JOHANNESBURG (Reuters) - African National Congress leaders began talks on Thursday to try to agree on potential partners to form a new South African government after the ANC lost its parliamentary majority for the first time in the democratic era.

The former liberation movement has run South Africa since it swept to power with Nelson Mandela at the helm in the 1994 election that marked the end of apartheid, but was punished for its chequered record in last week's election.

While still the largest party, the ANC can no longer govern alone and signalled on Wednesday it would seek to form a government of national unity with a wide range of parties.

"This is a time for sober minds," said ANC Secretary-General Fikile Mbalula as members of the party's National Executive Committee (NEC) gathered at a Johannesburg hotel for a day of talks on what strategy to pursue.

"We're not dealing with the discussions from a point of view of locking ourselves into one option. We're looking at all options," he told reporters.

Mbalula said President Cyril Ramaphosa would disclose what the NEC had decided in a closing address.

The stakes are high for South Africa, which has been struggling with sluggish economic growth, high levels of poverty and unemployment, a persistent racial wealth divide, severe power shortages and political corruption.

The electoral maths has created a complex situation for the ANC, which will have 159 of the 400 seats in the new National Assembly.

Its nearest rivals are the pro-business, white-led Democratic Alliance (DA), with 87 seats, the populist uMkhonto we Sizwe (MK) led by former president Jacob Zuma, with 58, and the hard-left Economic Freedom Fighters (EFF) with 39.

"We have engaged with everybody and we are talking to even smaller parties. We want to bring everyone on board," said Mbalula.

The DA, for its part, signalled on Wednesday that it did not want to join a government that also included MK or the EFF.

ANC COALITION-BUILDING HAS NO EASY ANSWER

Any deal with the DA would be welcomed by financial markets but unpopular with many ANC supporters who regard it as a champion of what some South Africans call "white monopoly capital".

Underlining that dynamic, a group of anti-DA protesters stood outside the hotel where the NEC meeting was taking place, holding placards with slogans such as "The DA wants to destroy the ANC" and "Not in our names".

On the other hand, a deal with the EFF or MK, which advocate nationalising mines and seizing land without compensation, would be more popular with some in the ANC base but rattle investors.

Both the EFF and MK are led by former ANC figures who broke away and are at odds with the current leadership. Zuma in particular openly loathes Ramaphosa, and his party said after the election that it would not work with "the ANC of Ramaphosa".

The ANC spokesperson said on Wednesday the party would not talk to any counterparts that demanded Ramaphosa's resignation as a condition of joining a governing alliance.

On Thursday, Mbalula added: "It's been very difficult to engage with MK. It depends after this meeting if we will still meet with them."

Zuma was forced to quit as president in 2018 after a series of corruption scandals, and was jailed for contempt of court after refusing to participate in an inquiry into corruption.

He remains well liked in his home province, populous KwaZulu-Natal, where extra police have been deployed this week to maintain public order. The province was the scene of deadly riots in 2021 when Zuma was sentenced.

(Additional reporting by Bhargav Acharya and Alexander Winning; Writing by Estelle Shirbon; Editing by Kevin Liffey)

By Kopano Gumbi and Nellie Peyton