(Bloomberg) -- South African stocks rallied and the rand gained, defying the global selloff in risk assets, as investors cheered an agreement between rival political parties to back the reelection of Cyril Ramaphosa as president.

The deal sets the stage for a broad government alliance led by the African National Congress and the business-friendly Democratic Alliance, following an election in which the ANC lost its outright majority for the first time since 1994.

“Such a coalition would be market-friendly and rand-positive,” said Yeon Jin Kim, an emerging-market analyst at Credit Agricole, in a note to clients. “In the medium term, we believe there could be more upside for the rand, provided key reforms are announced and implemented.”

The FTSE JSE Africa All Share Index climbed as much as 1.6%, the most in seven weeks, before paring the advance. A gauge of banking stocks rallied the most in almost four years to a record high.

The rand gained 0.5% to 18.3513 per dollar as of 1:02 p.m. in Johannesburg, the only emerging-market currency to rise on the day among 24 monitored by Bloomberg. The rand is up 3% this week compared with a 0.4% decline for the MSCI EM Currency Index.

The ANC, which has held power since apartheid ended in 1994, invited all the country’s main parties to join a so-called government of national unity. Former President Jacob Zuma’s uMkhonto weSizwe Party, or MKP, and the Economic Freedom Fighters, — both of which favor land expropriation and the nationalization of mines and banks — declined to participate. 

©2024 Bloomberg L.P.