Malaysia's three biggest opposition parties, grouped under the Pakatan Rakyat (PR) flag, are openly squabbling over a plan to remove the chief minister of Selangor, the second infighting in three months that is threatening to split the six-year-old alliance.

The alliance's leaders had exchanged harsh words in April and May after PR member Parti Islam SeMalaysia (PAS) tried to introduce the Islamic penal code in Kelantan state. A split was averted only when PAS backed down.

The alliance's two other members are the multiracial Parti Keadilan Rakyat (PKR), led by opposition chief Anwar Ibrahim, and Chinese-based Democratic Action Party (DAP).

The current crisis started when Anwar's party decided in March to replace Selangor Menteri Besar Abdul Khalid Ibrahim, a key PKR leader, for ineffectual leadership that has eroded voter support.

Khalid, who is into his second term as chief minister, has been blamed for water supply problems in many districts in Selangor, Kuala Lumpur and Putrajaya.

He is also accused of failing to force the state's Islamic authorities to return Malay language copies of the Bible seized from a Christian organisation.

Additionally, he is blamed for the state government's failure to stop a plan to build a highway called Kidex, which is opposed by some residents as it will run through their neighbourhoods.

To critics of PKR, the plan to remove Khalid is Anwar's way of settling a power struggle between the Selangor chief minister and PKR deputy president Azmin Ali, who wants the post.

Anwar has proposed his wife, PKR president Wan Azizah Wan Ismail, as the next chief minister.

But PKR cannot remove Khalid on its own as the state government is formed by the PR alliance. PKR needs to obtain the agreement of PAS and DAP.

But PAS, after apparently agreeing to Khalid's removal at a PR leadership council meeting last Wednesday, has made an about-turn with serious implications for the opposition alliance.

The break-up of PR will dash the hopes of many Malaysians for a two-party system that will end the monopoly on power of the federal ruling coalition, Barisan Nasional.

PAS president Abdul Hadi Awang - who did not attend the council meeting - said on Saturday that there had been no such agreement.

He said: "If he (Khalid) is involved in a scandal, breach of trust, misappropriation of government funds, then we can change. But if it is because of other reasons, we should not change the chief minister. Let him complete his term."

PKR secretary-general Saifuddin Nasution quickly issued a statement saying PAS could not back out of the agreement made at the leadership council.

"This process is the highest decision-making mechanism in Pakatan Rakyat that has been respected ever since Pakatan Rakyat was founded.

"Every party is represented by the top leadership that is given the mandate to convey the decision of its respective party in Pakatan Rakyat," Saifuddin said in a statement.

A worried DAP said the three-party alliance could be in danger of a break-up.

DAP secretary-general Lim Guan Eng said in a statement on Sunday: "If the decisions we have achieved together in the Pakatan's highest leadership council are dismissed just like that by one party, the survival and credibility of Pakatan will continue to be undermined."

Amid the tensions, PKR's de-facto chief Anwar said on Sunday in a three-paragraph statement that he believed the "spirit of consensus in Pakatan Rakyat" will prevail.

With Khalid insisting that he will not resign, the PR alliance might next try to propose a motion of no-confidence in the 56-seat Selangor state legislature.

But with PAS against the plan to oust Khalid and the state's opposition, Barisan Nasional, expected to block the move too, a stalemate could result.

Simply put, the PR public squabbling is expected to drag on, embarrassing the alliance which is keen to show it is united and a viable alternative to Barisan Nasional in running the country.