KUALA LUMPUR, Malaysia — The conspirators were confident. They planned to confront Malaysia’s prime minister, Najib Razak, at a cabinet meeting and demand his resignation. Prosecutors had collected evidence that Mr. Najib had deposited millions of dollars of public money into his personal bank account. Attorney General Abdul Gani Patail was ready to file criminal charges, according to Najib advisers and opposition leaders.
Mr. Najib had a reputation as a gentleman who was slow to act and never fired anyone. But when word of the plot reached him last July, he moved quickly. He dismissed both Deputy Prime Minister Muhyiddin Yassin, the man who would have taken his job, and the attorney general. And he blocked further inquiries into the allegations against him.
“They took it for granted that he was a sitting duck,” said Tony Pua, an opposition member of Parliament. “He turned the tables on them.”
Throughout Mr. Najib’s 40 years in public office, he has been easy to underestimate.
This month, the Justice Department filed a civil complaint in a money-laundering case outlining how Mr. Najib, identified as “Malaysian Official 1,” received $731 million from a government fund he oversaw. Investigators around the world are tracking the money trail to his bank accounts in what has become a billion-dollar scandal.
But Mr. Najib, a genteel, British-educated aristocrat who became prime minister in 2009, faces no realistic challenge to his authority and is confidently looking ahead to winning re-election in 2018.
The bank transfers are not the first scandal to threaten the career of Mr. Najib, 63, one of America’s most important allies in Southeast Asia. Over the years, he has been accused of having ties to a murder, taking kickbacks from the purchase of military hardware and helping concoct a criminal prosecution against a rival.
He has deployed the formidable powers of his office to impede investigations, silence critics, block media outlets and maintain the backing of his largely rural, Muslim base. He has deftly played Malaysia’s brand of money politics, distributing cash to buy party leaders’ loyalty.
As prime minister, he oversees Parliament, the cabinet, the police and the intelligence branch. As president of the governing party, he decides who holds key leadership positions and sits atop a vast patronage system that affects the wealth and livelihood of thousands of people.
He appointed himself finance minister, giving himself control of the state investment fund at the heart of the scandal.
For the United States, Mr. Najib has offered the promise of a moderate Muslim ally and an Asian partner in counterterrorism, whose nation is one of the 12 negotiating the Trans-Pacific Partnership trade agreement. As a sign of Malaysia’s growing importance, President Obama visited the country and met with Mr. Najib in 2014 and 2015. In between, they golfed together in Hawaii.
While that relationship did not deter the Justice Department investigation, his relationship with Saudi Arabia has been more helpful. Mr. Najib’s advisers say most of the money at issue was a gift from the Saudis, partly to help finance his 2013 election campaign, a position the Saudi government has loosely corroborated.
Malaysians grumble about Mr. Najib’s wealth, which he claims to have inherited, and the extravagance of his wife, Rosmah Mansor, who is known for epic overseas shopping excursions and her multimillion-dollar collection of Hermès Birkin handbags.
The allegations of high-level corruption and the lack of any impartial Malaysian investigation highlight the fact that the region’s movement toward democracy has left Malaysia untouched, said Donald Greenlees, an authority on Southeast Asia with Australian National University.
“Najib is a throwback to the era of Marcos’s Philippines and Suharto’s Indonesia with ruling families hungry for power and great wealth,” he said. “Imelda had her shoes and Rosmah has her Birkin bags. But the bags are vastly more valuable than the shoes.”
Mr. Najib has acknowledged receiving hundreds of millions of dollars, but says he has done nothing wrong and took nothing for personal gain. He said his government would “fully cooperate” with the Justice Department investigation.
“Don’t think I am a crook,” he told the party faithful in March at a rally in Pahang, his home state. “If I had wanted to rob, I would have robbed the forest here long ago. I didn’t take a single tree in Pahang. I didn’t take the bauxite mine. I didn’t take anything.”
Mr. Najib is accused of taking money from a state investment fund called 1 Malaysia Development Berhad, or 1MDB. He gave himself extraordinary authority over the fund as both finance minister and, until recently, advisory board chairman. The United States attorney general, Loretta Lynch, said Malaysian officials had laundered more than $3 billion from the fund through American financial institutions.
Mr. Najib’s advisers acknowledge that he received $1 billion but assert that most of it was a gift from a member of the Saudi royal family.
The current Malaysian attorney general, Mohamed Apandi Ali, announced in January that Mr. Najib had received $681 million from the Saudis and returned all but $61 million. He cleared Mr. Najib of wrongdoing and closed an investigation by the Malaysian anticorruption commission.
Mr. Najib and Ms. Rosmah declined through a spokesman to be interviewed for this article.
Mr. Najib was destined to become prime minister, his friends and supporters say. His father was Malaysia’s second prime minister, and his uncle the third.
Balding, with a neatly trimmed graying mustache and silver-rim glasses, Mr. Najib behaves like a British gentleman with impeccable manners, they say. He is often dressed formally even for late-night meetings at his home. He is viewed as a numbers guy with an keen eye for detail.
“He’s very cool,” said Fatmi Che Salleh, his longtime friend and former political secretary. “He takes things one at a time. Everything is planned, what to do, how to do, especially now we see so many attacks on him.”
Mr. Najib grew up in a household immersed in the politics of an emerging nation and its governing party, the United Malays National Organization, or UMNO.
He was educated in Britain and studied economics, rejecting the advice of his father, Prime Minister Abdul Razak, to become an accountant.
As prime minister, Mr. Abdul Razak was well known for his frugality. He refused his children’s plea to install a swimming pool at the official residence because it would waste government funds, one brother recalled. The lesson on thrift was another piece of fatherly wisdom Mr. Najib ignored.
When Mr. Abdul Razak died in 1976, Mr. Najib ran for his father’s parliamentary seat and at 22 became the youngest person ever elected to Malaysia’s Parliament. He married a minor princess, with whom he had three children.
In the mid-1980s, Mr. Najib met Ms. Rosmah, who was married with two children. The pair divorced their spouses and married in 1987. They have two children together.
Mr. Najib steadily climbed the party ladder, receiving help along the way from UMNO leaders indebted to his father, including Mahathir Mohamed, who succeeded Mr. Najib’s uncle as prime minister.
“I owed his father a great deal,” Mr. Mahathir, 91, said in an interview. “If I could do something for the son, especially as the son looks very promising, I would do it.”
He has spent his entire adult life in elective office, living in a bubble, surrounded by aides and devotees. On a trip to Europe, he did not know how to check in for a flight or find his departure gate, said a friend who traveled with him. He never packed his own suitcase; for a two-day trip, his servants packed him six suits.
Mr. Najib was deputy prime minister when the murder of a Mongolian woman and corruption allegations over the $1.2 billion purchase of two Franco-Spanish Scorpene submarines nearly derailed his career.
The woman, Altantuya Shaariibuu, was the mistress of his close friend and adviser, Abdul Razak Baginda. She claimed she was owed $500,000 for helping broker the submarine deal. In 2006, she was killed by two of Mr. Najib’s bodyguards, who tried to hide the evidence by blowing up her body with C-4 explosives. They were convicted of murder.
Mr. Najib has denied meeting Ms. Altantuya or having a role in her death. But a decade later, he is still dogged by allegations that he was connected to the killing and received kickbacks from the submarine purchases. The French authorities are investigating whether a French company paid Mr. Najib and Mr. Abdul Razak $130 million to secure the sale. The two deny any wrongdoing.
Mr. Najib’s name has also been attached to another murky episode, the criminal case that sidelined his biggest rival, Anwar Ibrahim, a former deputy prime minister who became leader of the opposition.
In a case widely seen as politically motivated, Mr. Anwar was imprisoned on sodomy charges in 1998. After his release in 2004, he began rebuilding the fractured opposition, and new sodomy charges were filed in 2008.
The accuser was Saiful Bukhari Azlan, an aide in Mr. Anwar’s party. At a trial, Mr. Saiful testified that he had met with Mr. Najib at his home two days before the sexual encounter. Mr. Saiful also met with senior police officials before the encounter.
It has never been fully explained how Mr. Najib, then deputy prime minister, happened to meet with a staff member from the opposition party at that time, or why Mr. Saiful met with police officials.
Mr. Anwar was acquitted and led the opposition to victory in the popular vote in 2013, though not by enough to overcome district lines favoring Mr. Najib’s coalition.
In 2014, an appellate court overturned Mr. Anwar’s acquittal and sentenced him to five years in prison. Opposition parties have yet to coalesce behind another leader.
When Mr. Najib became prime minister seven years ago, he inherited a political system awash in cash.
“In Malaysia, politics is about money,” said Oh Ei Sun, a former political secretary to Mr. Najib and an adjunct senior fellow at the S. Rajaratnam School of International Studies in Singapore. “It’s not a contest about your brilliant ideas.” Indeed, parties vie for votes by funneling money to loyal followers and financing overdue public works projects.
In May 2010, Mr. Najib demonstrated how the system works. During a by-election, he promised voters in the Sibu district that his government would pay $1.3 million for a flood-control project if his candidate won. “The understanding is quite simple,” he said. “You help me, I help you.”
He poured more than $300 million into the 2013 parliamentary elections campaign, his advisers say.
Malaysia has no limits on how much party leaders can raise or spend, and there is no reporting requirement, said Wan Saiful Wan Jan, the chief executive of the Institute for Democracy and Economic Affairs, a Malaysia think tank. The money is tax free, and much of it is distributed to local party leaders, who can easily pocket a share.
No law prohibits candidates from depositing donations in their personal bank accounts, even $1 billion.
“I don’t think Najib is the only one,” Mr. Wan Saiful said. “I don’t even know if he’s the biggest.”
The story of the Saudi gift has evolved with new revelations about deposits into Mr. Najib’s accounts.
Mr. Najib’s government said in January that $681 million was a gift from a member of the Saudi royal family. After questions were raised about additional deposits of hundreds of millions of dollars, Mr. Najib’s advisers said Saudi donors had given him about $1 billion.
His office declined to provide documentation demonstrating that either sum was a gift.
The Saudis, too, have changed their story. In February, the Saudi foreign minister, Adel al-Jubeir, said the money had come not from the government, but rather from a private citizen making “an investment in Malaysia.”
In April, after Mr. Najib and his aides met privately with Mr. Jubeir in Istanbul, Mr. Jubeir said Mr. Najib had received a gift from an unidentified Saudi source.
“It is a genuine donation with nothing expected in return,” he said.
Mr. Najib has cultivated close ties with Saudi Arabia, but even so, experts say, a gift of $1 billion was unlikely. “Nobody believes that the money came from Saudi Arabia,” said James Chin, the director of the Asia Institute at the University of Tasmania.
The Justice Department complaint said Mr. Najib’s relatives and associates had taken more than $1 billion from 1MDB, spending it on luxury real estate, gambling, Hollywood moviemaking and high-priced artwork.
Ibrahim Suffian, the director of the Merdeka Center, an independent polling agency in Malaysia, said surveys showed that two-thirds of the public were unhappy with Mr. Najib, yet people feel powerless to remove him from office.
As popular support has eroded, Mr. Najib’s government has blocked news outlets, prevented opposition leaders from campaigning and prosecuted critics under a colonial-era sedition act that he once promised to repeal.
“Clearly, in order to save his own political skin, he’s prepared to destroy what little remains of basic civil liberties and human rights in Malaysia,” said Phil Robertson, the deputy director of the Asia division of Human Rights Watch.
The effort to force Mr. Najib from office — and the threat of prison — have given him new resolve to remain in power until the 2018 election and beyond, advisers say. His prospects are good.
“He will be more invincible in 2018,” said Mr. Oh, the former Najib aide, “because as it is, he is already unstoppable.”