Muhyiddin, who led Malaysia for 17 months between 2020 and 2021, was charged at a court in the northeastern state of Kelantan with sedition over remarks made in a political speech this month. He pleaded not guilty, his lawyer said.
Malaysia practices a unique form of monarchy, where the country's nine sultans take turns to be king every five years. The monarchy plays a largely ceremonial role and is held in deep respect.
Negative remarks about royalty can be prosecuted under a colonial-era Sedition Act.
In a political speech on Aug. 15, Muhyiddin had allegedly questioned the credibility of former king, Yang di-Pertuan Agong Al-Sultan Abdullah Ri'ayatuddin Al-Mustafa Billah Shah following Malaysia's general election in 2022, which resulted in a hung parliament, according to local media reports.
In the speech, Muhyiddin said, according to the reports, that he had secured the backing of sufficient lawmakers to form a government after the election but questioned why Al-Sultan Abdullah had not invited him to be sworn in as the country's premier, the reports said.
Al-Sultan Abdullah appointed Datuk Seri Anwar Ibrahim prime minister in November 2022. Al-Sultan Abdullah's five-year reign as king ended in January.
Al-Sultan Abdullah has made no public comment on the reported remarks by Muhyiddin and his office could not immediately be reached for comment.
Muhyiddin, who leads Malaysia's conservative, Malay-centric opposition bloc, faces up to three years in prison and a maximum penalty of 5,000 ringgit ($1,148) if found guilty, his lawyer said.
He has also been accused of corruption and money laundering in a separate case filed against him last year - charges he has deemed politically motivated.
Anwar's government has denied targeting political rivals, saying the charges were part of an effort to tackle high-level corruption.