KUALA LUMPUR, Malaysia — Najib Razak, the former prime minister of Malaysia who was ousted in an election two months ago, was charged by anticorruption officials on Wednesday, after his arrest in an investigation involving billions of dollars diverted from a state investment fund.

He was charged with three counts of criminal breach of trust and one count of corruption in connection with the investment fund scandal. He pleaded not guilty on all counts.

Atop a political machine that had governed Malaysia since its independence in 1957, Mr. Najib and his allies used political influence, cash handouts and news media repression to try to keep corruption accusations at bay for years.

But in May, voter anger over the scandal at the investment fund, 1Malaysia Development Berhad, led to a sweeping victory for a sprawling opposition movement that came together to oust Mr. Najib.