KUALA LUMPUR, Malaysia — Malaysia’s ruling party is facing its greatest crisis of legitimacy yet. Long seen as a modern and moderate Muslim democracy, Malaysia has been riding on its economic growth and good diplomacy for years, and the United Malays National Organization (UMNO), which has led coalition governments for nearly six decades, has been claiming the credit.

But rampant corruption, curbs on freedom of expression, a slowing economy and a currency in free fall have eroded public trust in the government’s stewardship. It hasn’t helped that Prime Minister Najib Razak recently reshuffled the cabinet, and sacked the deputy prime minister and the attorney general for asking uncomfortable questions. Or that once again the ruling coalition, Barisan Nasional (BN), is using its influence over government agencies to bypass or manipulate electoral rules to its advantage, most recently through gerrymandering in the eastern state of Sarawak.

The last general election, in 2013, was criticized for many irregularities: flawed voter lists, gags on the media, the malapportionment of seats in Parliament and state legislatures. Although the Constitution highlights the importance of having a national Election Commission that “enjoys public confidence,” the commission has been doing the government’s bidding for many years. BN won just over 47 percent of the popular vote in 2013, compared with nearly 51 percent for the opposition. But it gained control of about 60 percent of the seats in Parliament.

The latest financial scandal to rock Mr. Najib also bears on electoral improprieties. The state investment fund 1Malaysia Development Berhad (1MDB), whose advisory board is chaired by the prime minister, is fending off allegations of mismanagement; critics say it cannot account for some 27 billion ringgit in debt (about $6.6 billion). In early July, the U.K.-based Sarawak Report website and The Wall Street Journal reported that nearly $700 million had been transferred into personal accounts of Mr. Najib just before the 2013 election, suggesting a connection to entities linked to 1MDB. The anti-corruption agency claims instead that the money was a donation from the Middle East.