* ANC failed to win majority in May 29 vote

* ANC, DA two biggest parties in unity government

* Investors expect economic policy continuity

JOHANNESBURG, June 19 (Reuters) - Investors are optimistic South Africa's new unity government can deliver stable economic policies to revive growth, but are cautious about how the new coalition's main partners can reconcile stark ideological differences.

The African National Congress (ANC) - which has governed since a vote in 1994 that marked the end of apartheid - has struck a deal with the white-led, pro-business Democratic Alliance (DA) and smaller parties after failing to win a parliamentary majority in national elections last month.

The agreement between the ideologically opposed ANC and DA marks a major political shift in the country and paves the way for a Government of National Unity under President Cyril Ramaphosa to bring in reforms needed to create economic growth and tackle high levels of unemployment and inequality.

Investors and credit rating agencies see the two biggest parties in the unity government agreeing on more liberal economic policies, but they could struggle to overcome their ideological differences.

The ANC, for instance, has increased spending on welfare payments, but the DA had in the run up to the election pushed to roll back some of them and to scrap some ANC Black empowerment policies.

The left-leaning Economic Freedom Fighters (EFF) and the party of former president Jacob Zuma, uMkhonto weSizwe (MK), will not join the unity government, choosing instead to be part of the opposition alliance.

"With populist parties choosing to reject the GNU, and the ANC's bigger partners in the governing coalition centre-leaning and favouring more liberal economic policies, we think the GNU opens the possibility for more growth-friendly structural reforms and prudent macroeconomic policy choices," HSBC economist David Faulkner said in a note.

"But the GNU could also face ideological divisions and exacerbate fractures within the ANC, factors that could make establishing a stable policy framework difficult."

Among its priorities, the unity government is set to focus on rapid, inclusive and sustainable economic growth, the promotion of fixed capital investment, job creation, land reform and infrastructure development, the ANC has said.

"The election outcome is broadly favourable for the economic and fiscal outlook, compared with the alternatives," S&P Global Ratings said on Tuesday, but it also said the government faces an uphill battle to revive growth and maintain fiscal discipline, while navigating the new realities of coalition politics.

"Despite the reasonably constructive outcome, significant ideological differences between the ANC and the DA on issues such as affirmative action and foreign policy could destabilise the government," S&P said.

Smaller parties in the unity government include the socially conservative Inkatha Freedom Party and the right-wing Patriotic Alliance.

MARKETS SURGE

Financial markets have welcomed the unity government, with South Africa's banking index, seen as a gauge of local economic recovery prospects, up 19% since June 7 - when the ANC announced it would seek to form a unity government.

The rand, one of the few emerging market currencies to chalk up gains since the start of the year, and local government bonds have also reacted positively.

"The spread between our bonds and U.S. bonds, it's pretty much back to where it was pre-election," said Mike van der Westhuizen, portfolio manager at Citadel, a local wealth management firm. "That risk premium in bonds is at sort of fair value," he added.

Investors anticipate that the unity government will pick up the pace on the ANC's existing reform plans for electricity, rail and port sectors. These are needed to revive an economy that has barely grown in the last decade and has an unemployment rate that is among the highest in the world.

The DA has endorsed a government programme code named "Operation Vulindlela", a Zulu term meaning clear the path, that was initiated in 2020 by the ANC-led government to speed up structural reforms.

Adam Furlan, emerging markets fixed income portfolio manager at NinetyOne investments - South Africa's largest asset manager, said the DA's desire to support the initiative bodes well for policy continuity.

"We expect that to continue and hopefully at a more brisk pace," said Furlan.

Ramaphosa is expected to announce his new cabinet, in consultation with his new coalition partners, a few days after his inauguration on Wednesday.

Some analysts expressed concern that the ANC was unlikely to give up the key finance portfolio.

"The best case scenario for asset prices from this point is that DA gets responsibility for finance, public enterprises, and energy, and the worst case, is that their cabinet representation is merely a token one," said Tellimer market research said in a note.

(Additional reporting by Nqobile Dludla; Editing by Olivia Kumwenda-Mtambo and Jane Merriman)