Najib Razak and his wife Rosmah Mansor planned to go on an overseas holiday but been banned from leaving the country, immigration officials say.
Earlier this week, Mr Najib's long-ruling Barisan Nasional coalition suffered a shock electoral defeat.
Mr Najib has been accused of diverting $700m (£517m) from a state investment fund in 2015, but has since been cleared by the authorities.
However Malaysia's new Prime Minister Mahathir Mohamad, who at 92 became the world's oldest elected leader when he was sworn in on Thursday, has said that Mr Najib could face a fresh investigation if sufficient evidence supports it.
Mr Mahathir has said that investigations will take place into alleged corruption in the country, including the case involving the state investment fund.
Mahathir Mohamad said he believed Malaysia "can get most of the 1MDB money back".
Mr Mahathir stood down as prime minister 15 years ago, but came out of retirement and defected to the opposition to take on and beat former protégé Najib Razak.
Mr Anwar's daughter, Nurul Izzah, on Saturday confirmed reports that her father will "receive a full royal pardon" and is due to be released on Tuesday.
In a tweet (in Malay), he said he had been informed by the immigration authorities that he and his family would not be allowed to travel abroad.
He gave no reasons for the authorities' decision, but said he would abide by it.
He has also announced he is quitting as chairman of the Barisan Nasional coalition and as president of his United Malay National Organisation party.
It is believed they intended to fly to Jakarta, the capital of Indonesia.
Mr Najib had faced accusations of corruption and mismanagement over the state investment fund 1Malaysia Development Berhad (1MDB).
1MDB, set up by Mr Najib in 2009, was meant to turn Kuala Lumpur into a financial hub and boost the economy through strategic investments.
But it started to attract negative attention in early 2015 after it missed payments for some of the $11bn it owed to banks and bondholders.
Then the Wall Street Journal (WSJ) reported it had seen a paper trail that allegedly traced close to $700m from the fund to Mr Najib's personal bank accounts.
Mr Najib has consistently denied taking money from 1MDB or any public funds.
After being sworn in as new prime minister, Mr Mahathir said he would seek the return of millions of dollars lost in the scandal.