Mahathir Mohamad, Malaysia's former prime minister, listens during an interview in Purtrajaya, Malaysia, on Tuesday, April 11, 2017. The six-decade rule of Prime Minister Najib Razak's ruling coalition may finally be nearing an end, according to Malaysia's longest-serving prime minister. Photographer: Sanjit Das/Bloomberg via Getty Images
Sanjit Das/Bloomberg via Getty Images
Mahathir Mohamad, Malaysia's former prime minister, listens during an interview in Purtrajaya, Malaysia, on Tuesday, April 11, 2017. The six-decade rule of Prime Minister Najib Razak's ruling coalition may finally be nearing an end, according to Malaysia's longest-serving prime minister. Photographer: Sanjit Das/Bloomberg via Getty Images
Now playing
02:12
Stunning comeback for Malaysia's ex-leader
Italy's newly appointed Prime minister Giuseppe Conte announces the list of his government at the Quirinale presidential palace on May 31, 2018 in Rome after a meeting with Italian President. (Photo by Tiziana FABI / AFP)        (Photo credit should read TIZIANA FABI/AFP/Getty Images)
TIZIANA FABI/AFP/AFP/Getty Images
Italy's newly appointed Prime minister Giuseppe Conte announces the list of his government at the Quirinale presidential palace on May 31, 2018 in Rome after a meeting with Italian President. (Photo by Tiziana FABI / AFP) (Photo credit should read TIZIANA FABI/AFP/Getty Images)
Now playing
01:33
Who is Italy's new Prime Minister?
Italys Prime Minister Giuseppe Conte (R) shakes hands with Italy's President Sergio Mattarella during the swearing in ceremony of the new government led by the newly-appointed PM at Quirinale Palace in Rome on June 1, 2018. - Italian cabinet members of the new government led by newly appointed Prime Minister are to be sworn in later in the day, after a last-ditch coalition deal was hammered out to end months of political deadlock, narrowly avoiding snap elections in the eurozone's third largest economy. (Photo by Alberto PIZZOLI / AFP)        (Photo credit should read ALBERTO PIZZOLI/AFP/Getty Images)
ALBERTO PIZZOLI/AFP/Getty Images
Italys Prime Minister Giuseppe Conte (R) shakes hands with Italy's President Sergio Mattarella during the swearing in ceremony of the new government led by the newly-appointed PM at Quirinale Palace in Rome on June 1, 2018. - Italian cabinet members of the new government led by newly appointed Prime Minister are to be sworn in later in the day, after a last-ditch coalition deal was hammered out to end months of political deadlock, narrowly avoiding snap elections in the eurozone's third largest economy. (Photo by Alberto PIZZOLI / AFP) (Photo credit should read ALBERTO PIZZOLI/AFP/Getty Images)
Now playing
01:08
Conte sworn in as Italy's Prime Minister
Spain's Prime Minister Mariano Rajoy is applauded by members of his party during the second day of a motion of no confidence session at the Spanish parliament in Madrid, Friday, June 1, 2018. Socialist opposition leader Pedro Sanchez is on the brink of ending Mariano Rajoy's more than six-year reign as Spanish prime minister in what would be the first ouster of a serving leader by parliament in four decades of democracy as Spain's conservative government appears doomed to lose a no-confidence vote in parliament(AP Photo/Francisco Seco)
Francisco Seco/AP
Spain's Prime Minister Mariano Rajoy is applauded by members of his party during the second day of a motion of no confidence session at the Spanish parliament in Madrid, Friday, June 1, 2018. Socialist opposition leader Pedro Sanchez is on the brink of ending Mariano Rajoy's more than six-year reign as Spanish prime minister in what would be the first ouster of a serving leader by parliament in four decades of democracy as Spain's conservative government appears doomed to lose a no-confidence vote in parliament(AP Photo/Francisco Seco)
Now playing
01:44
Rajoy forced out as Spain's Prime Minister
French president-elect Emmanuel Macron greets supporters before delivering a speech in front of the Pyramid at the Louvre Museum in Paris on May 7, 2017, after the second round of the French presidential election.
 (Photo credit should read ERIC FEFERBERG/AFP/Getty Images)
ERIC FEFERBERG/AFP/Getty Images
French president-elect Emmanuel Macron greets supporters before delivering a speech in front of the Pyramid at the Louvre Museum in Paris on May 7, 2017, after the second round of the French presidential election. (Photo credit should read ERIC FEFERBERG/AFP/Getty Images)
Now playing
01:32
What to know about Emmanuel Macron
Adam Berry/Getty Images
Now playing
02:08
Angela Merkel: Germany's beloved 'Mom'
Armenian opposition leader Nikol Pashinyan gestures to supporters after being elected as prime minister in Yerevan's Republic Square on May 8, 2018. (Photo by Sergei GAPON / AFP)        (Photo credit should read SERGEI GAPON/AFP/Getty Images)
SERGEI GAPON/AFP/Getty Images
Armenian opposition leader Nikol Pashinyan gestures to supporters after being elected as prime minister in Yerevan's Republic Square on May 8, 2018. (Photo by Sergei GAPON / AFP) (Photo credit should read SERGEI GAPON/AFP/Getty Images)
Now playing
01:16
Armenia elects new prime minister
Now playing
01:51
Who is Kim Jong Un?
CNN Illustration/Getty Images
Now playing
01:51
The secret behind Vladimir Putin's power
Japanese Emperor Akihito waves to well-wishers gathered for the annual New Year's greetings at the Imperial Palace in Tokyo on January 2, 2016.
KAZUHIRO NOGI/AFP/Getty Images
Japanese Emperor Akihito waves to well-wishers gathered for the annual New Year's greetings at the Imperial Palace in Tokyo on January 2, 2016.
Now playing
00:53
Who is Emperor Akihito of Japan?
Britain's Home Secretary Theresa May addresses delegates on the third day of the annual Conservative party conference in Manchester, north west England, on October 6, 2015. AFP PHOTO / LEON NEAL        (Photo credit should read LEON NEAL/AFP/Getty Images)
LEON NEAL/AFP/Getty Images
Britain's Home Secretary Theresa May addresses delegates on the third day of the annual Conservative party conference in Manchester, north west England, on October 6, 2015. AFP PHOTO / LEON NEAL (Photo credit should read LEON NEAL/AFP/Getty Images)
Now playing
01:18
Who is Theresa May?
Canadian Liberal Party leader Justin Trudeau leaves after casting his ballot with his wife Sophie and their children Hadrien(L), Ella-Grace(2nd-R) and Xavier(R) in Montreal on October 19, 2015. The first of 65,000 polling stations opened Monday on Canada's Atlantic seaboard for legislative elections that pitted Prime Minister Stephen's Tories against liberal and social democratic parties. Up to 26.4 million electors are expected to vote in 338 electoral districts. Some 3.6 million already cast a ballot in advance voting a week ago, and the turnout Monday is expected to be high.   AFP PHOTO/NICHOLAS KAMM        (Photo credit should read NICHOLAS KAMM/AFP/Getty Images)
NICHOLAS KAMM/AFP/Getty Images
Canadian Liberal Party leader Justin Trudeau leaves after casting his ballot with his wife Sophie and their children Hadrien(L), Ella-Grace(2nd-R) and Xavier(R) in Montreal on October 19, 2015. The first of 65,000 polling stations opened Monday on Canada's Atlantic seaboard for legislative elections that pitted Prime Minister Stephen's Tories against liberal and social democratic parties. Up to 26.4 million electors are expected to vote in 338 electoral districts. Some 3.6 million already cast a ballot in advance voting a week ago, and the turnout Monday is expected to be high. AFP PHOTO/NICHOLAS KAMM (Photo credit should read NICHOLAS KAMM/AFP/Getty Images)
Now playing
02:05
Who is Justin Trudeau?
Now playing
01:48
Is THIS the world's most interesting man?
putin profile chance orig_00003129.jpg
putin profile chance orig_00003129.jpg
Now playing
01:45
Vladimir Putin: The Russian action man
dnt coren skorea new president_00023229.jpg
dnt coren skorea new president_00023229.jpg
Now playing
02:35
S. Korea's president born into politics
MAXWELL, IA - FEBRUARY 16: China's Vice President Xi Jinping of the People's Republic of China visits the farm of Rick and Martha Kimberley February 16, 2012 near Maxwell, Iowa. Xi , who is seen as China's likely next leader, is on a tour of the U.S. that will send him to California next. (Photo by Steve Pope/Office of the Iowa Governor via Getty Images)
Photo by Steve Pope/Office of the Iowa Governor via Getty Images
MAXWELL, IA - FEBRUARY 16: China's Vice President Xi Jinping of the People's Republic of China visits the farm of Rick and Martha Kimberley February 16, 2012 near Maxwell, Iowa. Xi , who is seen as China's likely next leader, is on a tour of the U.S. that will send him to California next. (Photo by Steve Pope/Office of the Iowa Governor via Getty Images)
Now playing
02:28
Who is Xi Jinping?
LONDON, ENGLAND - FEBRUARY 06:  Israeli Prime Minister Benjamin Netanyahu speaks during a meeting with Britain's Foreign Secretary Boris Johnson (not pictured) at the Foreign Office on February 6, 2017 in London, England. Mr Netanyahu is meeting with Foreign Minister Boris Johnson and PM Theresa May during his trip to london and is expected to discuss a number of issues including defence and bilateral trade.  (Photo by Kirsty Wigglesworth - WPA Pool/Getty Images)
WPA Pool/Getty Images Europe/Getty Images
LONDON, ENGLAND - FEBRUARY 06: Israeli Prime Minister Benjamin Netanyahu speaks during a meeting with Britain's Foreign Secretary Boris Johnson (not pictured) at the Foreign Office on February 6, 2017 in London, England. Mr Netanyahu is meeting with Foreign Minister Boris Johnson and PM Theresa May during his trip to london and is expected to discuss a number of issues including defence and bilateral trade. (Photo by Kirsty Wigglesworth - WPA Pool/Getty Images)
Now playing
01:43
Netanyahu: How he rose to the top
Barack Obama delivers his inaugural addresses on January 20, 2009 and January 21, 2013.
CNN/Getty Images
Barack Obama delivers his inaugural addresses on January 20, 2009 and January 21, 2013.
Now playing
01:34
Obama's inaugural address: Then and now
hollande.victory.speech_00023807
hollande.victory.speech_00023807
Now playing
05:11
Hollande: I've heard call for change
(CNN) —  

Veteran Malaysian politician Mahathir Mohamad has become the world’s oldest leader after a shock victory in the country’s election, upending six decades of control by the ruling coalition.

The 92-year-old was sworn in on Thursday night by Malaysia’s constitutional ruler, King Muhammad V, following a momentous vote in which scandal-plagued incumbent Najib Razak was soundly beaten at the polls by his former mentor.

It’s a triumphant return to front-line Malaysian politics for Prime Minister Mahathir, who also ruled the country from 1981 until 2003.

He was sworn in by the Malaysian head of state at about 9:50 p.m. (9.50 a.m. ET). It followed a day of confusion over the status of Malaysia’s new government, with various times announced and then missed for Mahathir’s official appointment.

His car was seen driving into the palace ahead of a possible 5 p.m. meeting, only for it to leave again an hour and a half later.

But in a press statement issued on Thursday night, the palace said it had invited Mahathir to form a government and “strongly” denied the king had delayed the appointment.

“His Majesty the King strongly supports and respects the democratic process,” the statement said.

Mahathir Mohamad celebrates with his coalition leaders during a press conference in Kuala Lumpur on May 10.
MANAN VATSYAYANA/AFP/AFP/Getty Images
Mahathir Mohamad celebrates with his coalition leaders during a press conference in Kuala Lumpur on May 10.

Who is ‘Dr. M,’ Malaysia’s new – and old – Prime Minister?

Political survivor

Mahathir, who governed the country for 22 years as strongman leader of the Barisan Nasional coalition, came out of retirement to challenge the incumbent in the country’s 14th general election.

In January, Mahathir said that running was “a job I have to do,” in an exclusive interview with CNN.

The veteran politician’s coalition won 121 seats, enough to form a simple majority and take control of the House. Barisan Nasional, the coalition that has led the country since independence, only won 79 seats, a far cry from the 133 it won in the 2013 election.

Supporters of Former Malaysian prime minister Mahathir Mohamad celebrate outside the National Palace.
MANAN VATSYAYANA/AFP/AFP/Getty Images
Supporters of Former Malaysian prime minister Mahathir Mohamad celebrate outside the National Palace.

Ousted Malaysian Prime Minister Najib had earlier conceded defeat.

Acknowledging the electoral bloodbath that saw his ruling Barisan Nasional coalition lose over 50 seats, Najib said that he accepted the “will of the people,” but also trumpeted the achievements of his government.

Despite the thrashing at the polls, Najib’s speech appeared to tease the possibility that the identity of the country’s next leader was not a foregone conclusion.

“Because no party got a simple majority, the King will decide whom to appoint as Prime Minister … Barisan Nasional will accept the King’s decision, and I urge all Malaysians to accept the decision calmly and place their faith in the King to make a wise decision.”

Outgoing Malaysian prime minister Najib Razak of the Barisan National party coalition arrives to address the media after his coalition's loss.
MOHD RASFAN/AFP/AFP/Getty Images
Outgoing Malaysian prime minister Najib Razak of the Barisan National party coalition arrives to address the media after his coalition's loss.

Pardon for former nemesis?

In his first press conference since his stunning win over Barisan Nasional, Mahathir said that he would move quickly to end an unpopular sales tax, and said that among his first acts would be to arrange for a pardon for his political ally – and one-time political nemesis – Anwar Ibrahim, to allow him to re-enter politics.

Anwar remains imprisoned after being found guilty of sodomy in 2015 – the second time he’s been imprisoned for the offense. He has long said that the charges are politically motivated.

He’s expected to be released in June, after serving the bulk of the sentence. Mahathir has previously pledged to seek a royal pardon, which would potentially pave the way for him to succeed the elderly Mahathir in just a couple of years.

Anwar’s wife, Wan Azizah, endorsed Mahathir and served as his deputy in the coalition to oust Najib. She was one of the dozens of opposition candidates elected Wednesday.

Asked about his other promise made during the campaign to pursue a corruption investigation into Najib, Mahathir maintained the former leader would be subject to the rule of law.

“If the law says Najib has done something wrong, then he will have to face the consequences,” he said.

He added that a recent, controversial fake news law widely seen as a political tool to quash dissent would go under review. Ahead of the election, Mahathir himself was one of the first targeted under the law.

“I cannot accept this country being destroyed by selfish people who only think about themselves … who steal money.”

Najib’s negative campaign and charges that he influenced the redistricting of constituencies to bolster his chances were compounded by long-running accusations of corruption, mostly stemming from a state fund, known as the 1Malaysia Development Berhad, commonly known as 1MDB.

Supporters of Mahathir Mohamad cheer as they watch live televised result announcement in Kuala Lumpur.
Ulet Ifansasti/Getty Images
Supporters of Mahathir Mohamad cheer as they watch live televised result announcement in Kuala Lumpur.

Najib was also under fire because of deeply unpopular moves such as the introduction of a goods and services tax (GST), which many Malaysians feel has caused the cost of living to spike sharply.

The defeated former leader also saw several members of his Cabinet, ministers and deputy ministers, defeated at the polls, and crashed out of eight of the battles for control of 12 state legislatures contested in the election.

Election day controversies

Polling day came with its own share of controversies. Voters in some areas were turned away by election officials for wearing shorts and flip-flops, despite a statement from the Electoral Commission’s chairman the day before that there would not be a dress code for voters.

There were also allegations of discrepancies in voting papers, with some voters who turned up to cast their ballots told that they had already voted.

Earlier Wednesday, opposition politicians claimed their phones and email accounts had been hacked and spammed, saying it was a deliberate attempt to disrupt their communications.

Marc Lourdes and Ushar Daniele reported from Kuala Lumpur. Euan McKirdy wrote from Hong Kong.