Earlier, Najib was banned from leaving the country with his wife after speculation mounted that they were about to flee, in a possible bid to avoid prosecution over the 1MDB case.
Barisan Nasional had been in power for more than 60 years before losing to a coalition led by Mohamad, his former mentor.
"It is true that I prevented Najib from leaving the country", Mahathir said at a news conference, adding that doing so had averted extradition problems later.
Malaysian Prime Minister Mahathir Mohamad moved ahead briskly with the formation of his new government on Saturday, appointing three key ministers and saying he would reopen the investigation into the multi-billion dollar scandal at the state investment fund.
The coalition's defeat in the election at the hands of an alliance led by his one-time mentor Mahathir Mohamad amounted to a political quake, which toppled an increasingly authoritarian regime that had ruled the country for six decades.
Dr Mahathir was sworn into office by Malaysia's constitutional monarch late on Thursday, becoming the world's oldest elected leader at the age of 92.
The alleged graft scandal against Najib was reported in 2015 and reports said that Najib's bank account received $700 million from the 1Malaysia Development Berhad fund (1MDB), set up in 2009 to promote economic development.
"I respect this instruction and will stay in the country with my family", he tweeted.
U.S. investigators say Najib's associates illegally took billions from the fund, with millions ending up in Najib's bank account or being used to buy jewelry for his wife.
Muhyiddin Yassin was named home affairs minister and Mohammad Sabu will serve as defence minister.
Najib said in a statement earlier in the day that he was leaving the country to take a break.
In a Twitter message on Friday, Najib said he was praying that, "after this divisive period", Malaysia would unite.
Filings by the US Justice Department in a civil lawsuit indicated almost $30 million of the money stolen was used to buy jewelry for Rosmah, including a rare 22-carat pink diamond set in a necklace. I apologise for any shortcomings and mistakes, and I thank you, the people, for the opportunity to lead our great nation.
The scandal became a major factor in the election and in the ouster of Najib Razak, Mahathir's predecessor and former protege. Mahathir has said that if Najib were found to do something wrong, "he will have to face the consequences".
"We need to do investigations on a lot of things", Mahathir said on Saturday in Kuala Lumpur.