Sri Lanka’s acting President Ranil Wickremesinghe has been voted in as next president on Wednesday.
He will serve until the end of Gotabaya Rajapaksa’s term in 2024.
Mr Wickremesinghe was seen as the front runner, despite calls for him to step down from protesters.
He said he has spent 45 years of his life in parliament and he is happy it has given him the honour of becoming president.
"I need not tell you the status our country is in. Now that the election is over we have to end this division. We had 48 hours to stay divided but from now on I am ready to have a dialogue with you," he said, asking other political parties to work with him.
As president, Mr Wickremesinghe now has the discretion to appoint a new prime minister.
It comes after the former President Rajapaksa fled country and quit amid protests over the economic crisis.
His resignation marked the end of the political dynasty in Sri Lanka as the family had power in the country for nearly 20 years.
Rajapaksa jetted to the Maldives after protesters stormed his official residence and took over key state buildings.
He faced tough competition from Dullas Alahapperuma but he won the secret ballot vote when 25 parliamentarians cast their votes.
Sri Lanka’s 22 million people have been struggling with the shortages of essentials including medicine, fuel and food in the economic crisis.
Presidents in Sri Lanka are normally elected by the public.
The responsibility falls on parliament only if the office of president becomes vacant before a term officially ends.