MALAYSIA'S opposition chief Anwar Ibrahim and his Pakatan Rakyat (PR) alliance have been through hell in the past few weeks.
The conservative faction of Parti Islam SeMalaysia (PAS) came close to breaking away from its two alliance partners, while the Sultan of Selangor snubbed Datuk Seri Anwar's choice of his wife as the state's new chief minister.
Meanwhile, playing in the background is the worry that Mr Anwar might go to jail again if he fails next month in his final appeal against a sodomy conviction.
So is the game over for Mr Anwar, the oft-cited "glue" that holds the PR together?
Although Mr Anwar, 66, and the PR have clearly been hurt by the squabbling, they could still hobble along as it were, aided by the fact that the next general election is not due until 2018 and that there is still popular support for having a viable opposition.
The tripartite PR garnered 51 per cent of the total votes at the general election held in May last year, compared with 47 per cent for the governing Barisan Nasional (BN) coalition.
This will help limit the decline in support for Mr Anwar and the PR caused by the infighting.
Now that Mr Azmin Ali, deputy president of Mr Anwar's Parti Keadilan Rakyat (PKR), has been appointed as Selangor's Menteri Besar, temperatures in the alliance should finally start to come down.
The turmoil seen in the past few weeks has created "no lasting damage for Pakatan because Malaysians have short memories and the general election is far away", Professor James Chin, political analyst at Monash University Malaysia, told The Straits Times.
"Pakatan as a coalition is still viable because its top leadership know that if they don't hang together, they will lose to Barisan Nasional," he added.
Even so, the open conflict in PR has led to questions about whether Mr Anwar can still read the opposition's pulse accurately.
In particular, his decision to try to replace the previous Selangor chief, Datuk Seri Khalid Ibrahim, with his wife, Datuk Seri Wan Azizah Wan Ismail, was considered a poor move by many.
It triggered a blatant revolt by key members of PAS, who were already unhappy with the pro-Anwar liberal factions of the alliance.
PAS president Abdul Hadi Awang openly denounced the nomination of Dr Wan Azizah, saying he did not want to see an "Anwar dynasty" in the making. PAS was already fuming that it had not even been consulted when Mr Anwar decided to replace Mr Khalid.
The infighting turned even uglier when PAS itself risked splintering over the Selangor Menteri Besar issue, with some sections supporting Mr Khalid while others chose to back Dr Wan Azizah.
Democratic Action Party (DAP) secretary-general Lim Guan Eng joined the melee when he accused PAS leaders of being "traitors", exposing yet another crack in the opposition alliance.
Nevertheless, party insiders note that even though things look bad now, Mr Anwar is already working behind the scenes to assert control and cool things down.
When Mr Azmin announced his 10-member Cabinet line-up for Selangor last Friday, the message sent out was that PAS had been punished for its revolt.
The previous line-up of 10 state executive councillors (excos) - as the state Cabinet members are called - had four PAS leaders, three from DAP and three from PKR including the Menteri Besar.
PAS has now lost one exco seat, which has been given to PKR - a sign that Mr Anwar still calls the shots in the opposition alliance.
"Now that Azmin has announced his Cabinet, they can begin the process of strengthening back Pakatan," said Associate Professor Samsul Adabi Mamat, political analyst at the National University of Malaysia.
The opposition looks like a mess to be sure, and Mr Anwar will have a huge task on his hands trying to make peace with the Islamic party, while assuring Chinese-based DAP that social justice and not the harsh Islamic law sought by PAS conservatives will remain the key mission of the PR alliance.
Still, the good thing for the battered opposition as it tries to patch up its self-inflicted wounds is that the Umno-led BN has not gained much either.
Prime Minister Najib Razak has been unable to reform Umno's image as a self-serving party, prompting former premier Mahathir Mohamad to fret recently that BN will lose the 2018 general election if things remain as they are.
If Mr Anwar gets thrown back into jail next month, it would certainly complicate matters in terms of who would lead the opposition alliance, but it would also galvanise voter support and draw the opposition's fractious members closer.
It has not been the best of times for Mr Anwar in his roller-coaster career as a politician, but for now, he is not to be counted out.