Six-time Prime Minister Wickremesinghe won 134 votes, according to official results, against 82 for his main opponent Dullas Alahapperuma and just three for left-wing candidate Anura Dissanayake.

“Our divisions are now over,” the new head of state said in a speech to parliament just after his election by MPs, calling on Mr. Alahapperuma to “join him in order to work together to pull the country out of crisis”.

He said he hoped to be sworn in later on Wednesday in a simple ceremony in the heavily guarded parliament building.

With the accession of the 73-year-old cacique to supreme responsibilities, the current cabinet is automatically dissolved.

President Wickremesinghe, elected for the remaining period of Mr Rajapaksa’s term, which ends in November 2024, must now choose a prime minister to form a new government.

He inherits a country of 22 million people ravaged by a catastrophic economic crisis that is causing shortages of food, medicine and fuel.

The island, which defaulted in April on its foreign debt of 51 billion dollars, does not even have enough foreign currency to finance its essential imports, and hopes for a rescue plan from the International Monetary Fund (IMF).

The Speaker of Parliament, Mahinda Abeywardana, said that “the eyes of the whole world” were riveted on Wednesday on this election to parliament, welcoming this “historic session, not only for parliament but also for the whole country”.