KUALA LUMPUR, Malaysia — In a historic election upset in a country that has been governed by just one coalition for decades, a Malaysian opposition bloc led by the 92-year-old former Prime Minister Mahathir Mohamad swept to a majority in national parliamentary elections.

Prime Minister Najib Razak, who is accused of stealing hundreds of millions of dollars in government funds, gave an emotional national address on Thursday, saying that he would “accept the verdict of the people.”

But the election’s result has not yet been settled. The country’s king must now rule on who will be the next prime minister, as the loose coalition of opposition parties led by Mr. Mahathir is not officially recognized as a single political entity.

In the end, if Prime Minister Najib is ousted, he may become vulnerable to criminal prosecution. And he still faces a United States Justice Department investigation and efforts to recover $1.7 billion in assets said to be acquired with laundered money.