KUALA LUMPUR - Malaysia's three-party opposition alliance has averted a damaging split by agreeing to support the wife of opposition leader Anwar Ibrahim as the next chief minister of Selangor, an industrial hub that is the country's richest state.
But while the parties shelved their differences, a weeks-long crisis over control of the state has exposed deep divisions in the alliance that could re-surface to hamper its chance of ousting the government in the next election, analysts say.
The opposition infighting - a boon for Malaysia's 57-year-old governing coalition - began when the Islamist PAS party refused to support Anwar's party's move to sack the current chief minister over accusations of incompetence and graft.
The top state official, Khalid Ibrahim, refused to accept the sacking and tried to cling to power, with the backing of the ruling coalition and support from PAS, which was opposed to Anwar's wife, Wan Azizah Wan Ismail, becoming chief minister.
Senior opposition figures warned the dispute could split the disparate multi-ethnic alliance, but PAS leaders stepped back from the brink late on Sunday by agreeing to support Wan Azizah.
The "Pakatan" (alliance) parties have taken strides towards national power in the last two elections, most recently in May 2013, but have been dogged by divisions between the secular ethnic Chinese party, Anwar's party, and PAS. The Islamist party itself is divided between conservatives and modernizers.
"The progressives in PAS need to decide if they want to remain in the old PAS or form a new party to replace PAS and create a more progressive agenda for the country," said Wan Saiful Wan Jan, a political analyst at the Institute for Democracy and Economic Affairs.
"They need to focus on the common agenda rather than highlighting differences," he said.
Legal experts said Khalid would probably have to step down in the coming weeks now that Anwar's wife, with PAS' backing, has the clear support of the majority in the state assembly.
Wan Azizah is widely seen as a proxy for her husband, a former finance minister whose own plans to take over the top state job were stymied by his conviction in March for sodomy, a ruling that rights activists say was politically motivated.
How well she runs Malaysia's most populous state until the next national election, due by 2018, will be crucial to the opposition's chances of taking power for the first time.
"There has been some damage in their public reputation, but given that there is no snap election and general elections are three to four years away from now, they have ample time to recover," said Ibrahim Suffian, director of the Merdeka Center research firm.