They were the oddest of political colleagues: a nonagenarian onetime autocrat and the former protégé he had jailed for sodomy.

Mahathir Mohamad, the 94-year-old prime minister of Malaysia, and his perennial presumptive heir, Anwar Ibrahim, joined forces in 2018 to oust a governing party to which both had once belonged. That party, the United Malays National Organization, known as UMNO, was at the center of the 1MDB scandal, the brazen looting of billions of dollars of Malaysia’s public funds.

But the unwieldy coalition that brought Mr. Mahathir and Mr. Anwar together crumbled on Monday.

After a flurry of meetings that had political analysts feverishly analyzing whose car was pulling up in which driveway, Mr. Mahathir submitted his letter of resignation as prime minister on Monday afternoon.

The move, however, did not appear to be designed to result in Mr. Mahathir actually giving up leadership of Malaysia, a job that he has held twice, analysts said.