Mr. Mahathir is campaigning as the leader of the opposition coalition, Pakatan Harapan, and if he does rise to power again in parliamentary elections this year, he will become the oldest head of government in the world.
But in vying for the post he left in 2003, when he was 78, Mr. Mahathir faces an uphill battle against Mr. Najib even though the prime minister stands accused of taking $731 million in government funds and depositing the money into his personal bank account. The incumbent has a formidable grip on power, plentiful campaign funding and the advantage of parliamentary district lines that are skewed in his favor — in part because of the political system Mr. Mahathir helped establish.
Mr. Najib heads the governing United Malays National Organization, Mr. Mahathir’s former party, which has held power since independence in 1957.
“Mahathir’s candidacy is a kind of Hail Mary pass from the opposition that has spent the past three years beset by infighting,” said Ibrahim Suffian, the director of the Merdeka Center, an independent polling agency.
Running with him for deputy prime minister is Wan Azizah Wan Ismail, whose husband, the opposition leader Anwar Ibrahim, was imprisoned under Mr. Mahathir for five years on corruption and sodomy charges.
Now, Mr. Mahathir is urging members of the opposition to put aside their past enmity and unite behind his leadership.
“This time, we are together to replace the government,” he said. “The government has been there for more than 60 years. It is time it goes.”
A doctor before entering politics, Mr. Mahathir remains sharp, and his memory of people and events is exceptional.
But he has a history of heart problems, and his aides carefully limit his daily schedule to conserve his strength.
At a rally in the industrial town of Perai, he took the podium just before 11 p.m. and spoke for nearly 30 minutes without notes to a standing-room-only crowd of about 2,500 supporters. He was clear and forceful, despite coughing at times.
But soon after his appearance, a planned interview with The New York Times was canceled because of a lingering respiratory ailment. On Feb. 9, he was admitted to the National Heart Institute in Kuala Lumpur, Malaysia’s capital, for six days for treatment of a chest infection.
The willingness of his onetime foes to line up behind Mr. Mahathir’s candidacy illustrates the weakness of an opposition that has never held power and is fragmented by ethnic divisions and personal rivalries.
Without Mr. Mahathir, analysts say, the four-party opposition coalition has no leader who can unify its factions and appeal to rural, ethnically Malay voters, who make up a decisive voting bloc.
“The reason Mahathir was named as the candidate for prime minister is quite straightforward: There is nobody else,” said Wan Saiful Wan Jan, chief executive of the Institute for Democracy and Economic Affairs in Kuala Lumpur.
Mr. Najib, 64, who last faced voters in 2013, must call an election by August. Some predict that the vote could come as early as April because it would ensure the absence of Mr. Anwar, 70, who was imprisoned three years ago under Mr. Najib after a second sodomy conviction.
A skilled orator who nearly defeated Mr. Najib in 2013, Mr. Anwar is scheduled to be released from prison in June. His supporters say all the charges against him have been politically motivated.
As prime minister from 1981 to 2003, Mr. Mahathir modernized the country’s economy and built landmark projects, including the Petronas towers in Kuala Lumpur, which at one point were the world’s tallest buildings.
He occasionally set off international outrage with anti-Semitic comments, including calling Jews “arrogant” and accusing them of deliberately trying to wreck Malaysia’s economy.
He also helped establish a strong central government that Mr. Najib has exploited to squelch any independent investigation of the money transfers to his personal account.
The United States Justice Department is conducting a criminal inquiry into more than $3.5 billion missing from the investment fund known as One Malaysia Development Berhad, which Mr. Najib oversaw. The Justice Department also has filed numerous lawsuits to seize $1.7 billion in assets including jewelry, real estate and Hollywood movie rights, that it says Mr. Najib’s family members and associates acquired with money from the fund and laundered through American financial institutions.
Mr. Najib has denied any wrongdoing. And President Trump greeted him warmly at the White House last September despite the Justice Department’s corruption case.
When he stepped down in 2003, Mr. Mahathir chose Abdullah Ahmad Badawi to succeed him as prime minister and Mr. Najib as his deputy. But by 2009, he was unhappy with Mr. Abdullah’s performance and pushed him out, paving the way for Mr. Najib to take over.
“Yes, I picked him,” Mr. Mahathir said in a 2016 interview with The Times. “I encouraged Badawi to pick Najib as his deputy, which means he would become the next prime minister. I was instrumental in the fall of Badawi also.”
Mr. Mahathir broke with the governing United Malays National Organization two years ago because of his unhappiness with Mr. Najib.
“This particular prime minister believes he can buy support,” Mr. Mahathir told The Times in September. “With money he can buy everybody. He needs to have money. So how does he get the money? He steals the money.”
Under Mr. Najib, he said, Malaysia is no longer a democracy.
“For us it is a dictatorship,” he said. “The rule of law is no longer enforced now.”
Mr. Mahathir will turn 93 in July, and there is little expectation that he would serve out a full five-year term. In effect, he is serving as a stand-in for a future leader, but for whom is not entirely clear.
“His role is to win the election and hold the position until someone else comes,” Mr. Wan Saiful said.
Some in the opposition hope it would be Mr. Anwar.
In the 1990s, he was Mr. Mahathir’s deputy prime minister and likely successor. But the two had a falling out, and Mr. Anwar was sent to prison by a court widely seen as carrying out Mr. Mahathir’s wishes.
Because of Mr. Anwar’s most recent conviction, he is barred from holding elective office for five years after his release. The ban could be reversed with a royal pardon or a successful appeal.
This month Mr. Anwar appeared in court on his latest appeal. In a brief interview as he stood surrounded by more than a dozen guards, he said he accepted Mr. Mahathir’s candidacy because the former prime minister had embraced the goals of the opposition.
“We are not supporting Mahathir as a person,” he said. “We are supporting the reform agenda he has committed to.”