South Africa's two main opposition parties have put aside huge ideological differences to unseat the ruling ANC in major cities it has controlled for 22 years, they said on Wednesday.
The African National Congress lost its majority in the local governments that rule Pretoria, Johannesburg and Port Elizabeth this month, its worst electoral performance since coming to power after apartheid, leaving the other parties free to discuss coalitions.
In the end, the gulf separating the Democratic Alliance (DA), a party with a largely white voter base, and the leftist Economic Freedom Fighters (EFF), was too great to form formal coalitions, but they made a pact which will allow the DA to rule the country's economic hubs.
Mmusi Maimane, a black politician whose leadership of the DA since last year has helped reform its image as a party for wealthy whites, welcomed the EFF's agreement to vote for it in the municipalities concerned.
"It is quite clear that we would never agree on ideological issues," Maimane said. "I welcome their offer to say that they will vote for us."
EFF leader Julius Malema, a former ANC youth leader who split from his former mentor President Jacob Zuma in acrimonious circumstances to form the breakaway party in 2013, said although he saw the DA as "white racists" it was worth making a pact with them to defeat the ANC.
"We are caught between two devils. The DA is a better devil than the ANC. We are not in bed with them," he told reporters in the Alexandra township in Johannesburg.
"We will vote for the opposition because the ANC must be removed from power."
The EFF and DA, which both said they would not work with the ANC because their supporters had voted for change, are far apart in terms of policy, approach and experience.
The DA is pro-business while the EFF wants to redistribute land from whites to blacks without compensation.
Malema said his party would work with the ANC only if it removed Zuma, made education free for all, and nationalized banks and mines.
ANC Secretary General Gwede Mantashe said his party could not accept those conditions.
"You don't take those decisions on your feet, or under pressure from the opposition, you don't do that," he told Talk Radio 702.
With EFF votes, the DA is now likely to form a minority administration in Tshwane, which includes the capital Pretoria, Malema said, adding that his party's support in Johannesburg hangs in the balance over an outstanding issue with the DA.
Malema said the EFF would assist the DA in the symbolically important Nelson Mandela Bay, which includes the manufacturing hub Port Elizabeth, although the DA said it would rule there without EFF help after forming a coalition with smaller parties.
But even with the coalition it had formed and the EFF's support, the DA is unlikely to form a government in the industrial region of Ekurhuleni that lies next to Johannesburg and hosts the country's main airport, Maimane said.
Some analysts said the minority governments may descend into wrangling, slowing decision-making or triggering new elections at a time when the country teeters on the verge of recession. Other analysts felt that close scrutiny on budgets by rival parties may help fight corruption.
"The fact that there are coalitions in the first place, that no party has a majority, is good for governance because now they are all keeping tabs on each other," said head of research at NKC African Economics, Francois Conradie. "The spending is going to happen in a cleaner and better way."