C ONVERSATIONS STOPPED. Lawmakers in the parliamentary lounge rose to their feet. Supporters thronged forward, offering their hands and congratulations. Anwar Ibrahim, the head of the largest party in Pakatan Harapan (PH), the governing coalition, had returned to parliament after a three-year absence, having won a by-election earlier this month. He could not fight for a seat during the election PH won in May, paving the way for Malaysia’s first ever change of government, because he was languishing in prison, for a third time, on trumped-up charges of sodomy (a crime in Malaysia). The man who first sent him there during a previous stint as prime minister, Mahathir Mohamad, now runs the country once again. First allies, then enemies and now allies again, the pair have a fraught relationship, the evolution of which will define the new government, for good or for ill.

Mr Anwar’s Parti Keadilan Rakyat (PKR) has 50 of PH' s 125 seats in parliament. The party run by Dr Mahathir, Bersatu, commands just 13. But Dr Mahathir, who was prime minister from 1981 to 2003, has star power. His huge popularity among bumiputras—Malays and other indigenous groups who make up most of the population—helped PH to victory. And because Mr Anwar was behind bars during the election, it is Dr Mahathir who holds the top job.

Dr Mahathir seems preoccupied with fortifying his own position. As prime minister he can dispense plum jobs. And his vast experience means he can easily steer the callow cabinet. Mr Anwar covets his spot. During the campaign Dr Mahathir said he would give way after two years. Recently, however, he has declared that the two-year handover was merely “a suggestion”. Managing the competing interests of PKR and Bersatu, says a member of the Democratic Action Party, the second-biggest in the coalition, is like trying to adjudicate between two fighting elephants.

Dr Mahathir appears to be encouraging dissent within PKR. The party is in the middle of a hard-fought campaign to decide its deputy leader. One candidate, Azmin Ali, who leads an occasionally rebellious faction, appears to have his tacit support. “The prime minister is more focused on political manoeuvrings than running the country,” complains a politician from PKR.

Another source of tension is the lack of agreement within the coalition on the affirmative-action policies enshrined in the constitution. They give the bumiputras preferential access to government jobs, places at university and state handouts. Both Dr Mahathir and Mr Anwar first rose to political prominence as members of UMNO, the ruling party until May, which champions this system. Bersatu does too: it does not even grant full membership to non-Malays. But PKR has many ethnic-Indian and -Chinese members and a much more egalitarian philosophy.

Mr Anwar says he plans to remain a backbencher, staying out of the cabinet until Dr Mahathir hands over the reins. He speaks publicly of frequent meetings and good relations with the prime minister, soothing talk of any deep rift. “In this period of transition [the prime minister] needs to be given full support and endorsement,” he says.

Yet Mr Anwar admits that many in PKR are disgruntled: “There’s a lot of dissatisfaction among party members because they would have expected more recognition.” His return to parliament is likely to heighten tensions. Many hope his presence will help spur liberal reforms, which are sorely needed after decades of increasingly authoritarian rule by UMNO, but which Dr Mahathir has been slow to adopt.