KUALA LUMPUR (Reuters) - Mahathir Mohamad was sworn in as Malaysia’s seventh prime minister on Thursday after a stunning election comeback, defeating the coalition that has ruled the nation for six decades since independence from Britain.

Malaysia’s constitutional monarch, Sultan Muhammad V, administered the oath of office just before 10 p.m. (1400 GMT), in a ceremony carried live on state television from the palace.

Mahathir, 92, dubbed the “Father of Modern Malaysia” during his previous 22 years in power until 2003, was dressed in a traditional black “baju melayu” tunic and sarong, with an Islamic cap on his head. His return from retirement makes him the oldest elected leader in the world.

Hundreds of Malaysians lined the road leading to the palace, waving party flags and cheering. The Election Commission announced the result long before dawn and there was some consternation in the capital Kuala Lumpur over the time taken to swear in the new prime minister.

At a press conference after being sworn in, Mahathir reassured the financial community and said he would prioritize stabilizing the economy and return billions of dollars lost in a graft scandal at state fund 1Malaysia Development Berhad (1MDB).

“We believe that we can get most of the 1MDB money back ... we have to increase the confidence of investors in the administration,” he told reporters.

Malaysian markets were closed and will reopen only on Monday, but overseas investors were nervous about the ouster of Prime Minister Najib Razak after a decade in office and the ringgit lost four percent in offshore trading.

An overseas Malaysian equity fund initially showed a 6 percent drop in share values but partly rebounded on Thursday.

“There should be no cause for any devaluation of the ringgit,” Mahathir said.

“As you know, we cannot revalue the ringgit too much, or else we will not be competitive, but we will try to make the ringgit as steady as possible,” he added.

Mahathir was known for his strongarm, sometimes pugnacious style of rule intolerant of dissent from 1981 to 2003, but also for transforming his Southeast Asian country from a sleepy backwater into a modern industrialized nation.

He came out of retirement to take on his ex-protege Najib.

Mahathir’s alliance of four parties trounced Najib’s Barisan Nasional (BN), the first time it had ever lost an election.

Earlier on Thursday, Najib appeared to raise doubts that Mahathir would immediately take office because no single party had won a simple majority of seats in the 222-member parliament, and it would be up to the monarch to decide.

Official results showed that Mahathir’s coalition won 121 seats, comfortably more than the 112 required to rule. But it has not been formally registered as an alliance.

In a jubilant mood, Mahathir joked about his age and about being labeled a dictator at the news conference.

“Please remember, I am a dictator,” he joked.

Slideshow ( 20 images )

RANKS WITH BREXIT, TRUMP WIN

Mahathir has repeated a promise to repeal a deeply unpopular goods and services tax (GST) introduced by Najib and review foreign investments, including major infrastructure projects that are part of China’s Belt and Road initiative.

Some economists raised concern his populist election promises could undermine economic prospects at an increasingly challenging time for emerging markets, despite hopes elsewhere he might revive his bold approach to economic management.

“This upset ranks up there with Brexit and the Trump election,” said Aninda Mitra, a senior sovereign analyst at BNY Mellon Investment Management. “I believe the ringgit will come under pressure as policy continuity will come under a cloud.”

Slideshow ( 20 images )

Mahathir said some of Malaysia’s debt are “too big” and need to be renegotiated.

Najib’s BN coalition won 79 seats, a collapse from the 133 taken in the 2013 election, which was itself the coalition’s worst performance at the polls ever at the time.

In a tweet, Najib congratulated Mahathir on his appointment as premier and said he would assist in a smooth transition of power.

Few had expected Mahathir to prevail against a coalition that has long relied on the support of the country’s ethnic-Malay majority.

However, he joined hands with jailed political leader Anwar Ibrahim, his one-time deputy with whom he famously fell out 20 years ago, and together their alliance exploited public disenchantment over the cost of living and the multi-billion-dollar 1MDB scandal that had dogged Najib since 2015.

Mahathir said that one of his first actions would be to seek a royal pardon for Anwar. Before the election he had promised to step aside once Anwar was free and let him become premier.

Anwar’s wife, Wan Azizah Wan Ismail, was sitting next to Mahathir at his news conference. Under an agreement with Mahathir, she is to be deputy prime minister.

Anwar was imprisoned, first under Mahathir’s rule on charges of corruption and sodomy. He was released in 2004 but jailed again under Najib in 2015. Anwar denied all charges against him.

Mahathir and Najib were once allies but they clashed over a scandal around 1Malaysia Development Berhad, a state fund from which billions of dollars were allegedly siphoned off.

The 1MDB affair is being investigated by at least six countries, although Najib has denied any wrongdoing and has been cleared by Malaysia’s attorney-general.

Mahathir had vowed to investigate the scandal if elected and bring missing funds back to Malaysia. On Thursday, he said that if Najib had done anything wrong he would “face the consequences”.

Najib conceded the election in a news conference but has not been seen in public since. He did not attend the swearing-in ceremony at the palace.