Mahathir said after winning a parliamentary seat, Anwar could potentially be appointed to the Cabinet.
Jailed Malaysian reformist Anwar Ibrahim was granted a full pardon on Wednesday and walked free from a hospital in Kuala Lumpur, capping dramatic changes in the Southeast Asian country since the government was ousted in an election upset last week.
Once a high flyer in the ruling party, Anwar was convicted of homosexual sodomy and an additional charge of corruption in 1998 amid a power struggle with Mahathir, at the peak of his authoritarian run in power. When Anwar made a push to increase his power, Mahathir had him jailed on politically-motivated sodomy charges.
Jack Seng, another supporter wearing a shirt with an image of Anwar behind bars, said he thought Mahathir and Anwar would resolve any tension between them.
The volatile relationship between Anwar and Mahathir, from friends to foes to allies, has dominated Malaysia's political landscape for more than three decades and is central to the future of the alliance.
Under a pre-election pact, Mahathir, 92, had vowed to enable Anwar's release and eventually step aside for him to become prime minister.
Anwar is seeking a royal pardon on the grounds of "miscarriage of justice", which would reverse his conviction and make him eligible to actively participate in politics.
Anwar emerged from the Cheras Rehabilitation Hospital on Wednesday after Malaysia's Pardon Board, which included the current King, chose to overturn the 2015 conviction, which is widely accepted to be politically motivated.More news: Apple Has Bigger Autonomous Car Fleet Than Uber, Tesla, Google
Dressed in a suit, Anwar waved to reporters as he was whisked from a hospital, where he was recovering from shoulder surgery, to an audience with Malaysia's king. "Mahathir is keeping to his deal".
"We are now in process of getting into details of matters he suppressed in his time", Mahathir said of Najib. He was initially supposed to name 10 ministers but appeared to have been stalled by horse-trading over positions.
The agenda for the Mahathir government includes scrapping a goods-and-services tax, reviewing large infrastructure projects, reintroducing fuel subsidies and cutting spending.
"The base case is that Mahathir passes the baton to Anwar".
Anwar's wife Wan Azizah Wan Ismail, who is the new deputy premier, has said there was no rush for Anwar to take over.
The lawsuits name Malaysian financier Low Taek Jho, also known as Jho Low, and Mr Najib's stepson Riza Aziz among the alleged beneficiaries of misappropriated funds.
"[In] an initial stage, maybe lasting one or two years, I will be prime minister", Mahathir told a Wall Street Journal conference in Tokyo via video link.
Malaysian Prime Minister Mahathir Mohamad says he will be the prime minister for up to two years and then play "a role in the background".More news: Trump and Xi Move To Resolve Shutdown of ZTE Corp
In a drama that earned worldwide scorn, Anwar was brought into court with a black eye after a beating from the country's police chief.
It was Anwar's second spell in prison.
It stung UMNO by winning 52 percent of the popular vote in 2013 but failed to take parliament due to government gerrymandering.
In 2004, Anwar was freed but in 2015 was jailed again for five years for sodomizing a former aide.
His opposition alliance broke up after its Islamist ally left.
The opposition alliance united by Anwar brought together unusual bedfellows: an ethnic Chinese pro-democracy party, the conservative Islamic PAS, and Anwar's own racially diverse party.
He had barred Najib from leaving Malaysia and pledged to reopen a corruption probe into state fund 1MDB.
In the WSJ report published online Tuesday, Dr Mahathir reportedly said he would not offer Najib freedom in an effort to reclaim the missing funds.More news: Tesla Driver in Utah Crash Says Autopilot Was Engaged