The now opposition leader is accused of insulting the former king during an election campaign rally earlier this month.
Former Malaysian Prime Minister Muhyiddin Yassin, who currently leads the main opposition coalition, has been charged with sedition for allegedly insulting the country's former king.
Muhyiddin appeared in court in the northeastern town of Gua Musang on Tuesday morning, where he pleaded not guilty.
The charges relate to comments he made on August 14 while campaigning in a state election for his conservative Perikatan Nasional alliance.
He could face up to three years in prison if convicted.
According to Malaysian media, Muhyiddin questioned why then-King Sultan Abdullah Sultan Ahmad Shah did not invite him to be prime minister after the November 2022 election.
Reports said Muhyiddin told the crowd that he was the political leader who had the necessary support from lawmakers to form a government.
The king asked Anwar Ibrahim to be prime minister after a hard-fought campaign.
Malaysia has a unique rotating monarchy in which the sultans of each of the nine peninsular states take turns being the country's king for a five-year term.
The monarchy plays a largely ceremonial role, but is deeply respected by Malays, who make up more than half the population. It has also taken on a more prominent role since May 2018, when the ruling Barisan Nasional coalition lost power for the first time since independence.
Sultan Abdullah has not commented on the case, but his son strongly criticised Muhyiddin, saying his comments were dangerous and could divide the people and cause them to lose faith in the royal institution.
Muhyiddin denied insulting the royals and said his comments were genuine.
Al-Sultan Abdullah from the central state of Pahang was replaced in January by Sultan Ibrahim Sultan Iskandar from the southern state of Johor.