Protesters in Sri Lanka defied tear gas, water cannon and a state of emergency to storm the prime minister's office on Wednesday after the country's embattled president fled overseas, with the crowd demanding both men step down in the face of an economic crisis.

In a televised statement Prime Minister Ranil Wickremesinghe said he had instructed the military and police to do "what is necessary to restore order".

People crowded to visit Sri Lankan President Gotabaya Rajapaksa's residence after it was overrun by protestors
People crowded to visit Sri Lankan President Gotabaya Rajapaksa's residence after it was overrun by protestors AFP / Arun SANKAR

But armed security personnel stood by in the grounds of his office as protesters, some holding national flags, milled and took pictures.

Other demonstrators at one point broke into state television studios, as the country's months-long political and economic crisis appeared to be moving towards a climax.

President Gotabaya Rajapaksa, 73, promised at the weekend to resign on Wednesday after escaping his own official residence in Colombo just before tens of thousands of protesters overran it.

Sri Lanka's president left behind cash worth $50,000 when he fled his official residence, which is now drawing crowds for whom the palace would normally have been off limits
Sri Lanka's president left behind cash worth $50,000 when he fled his official residence, which is now drawing crowds for whom the palace would normally have been off limits AFP / Arun SANKAR

He flew to the neighbouring Maldives early Wednesday: as president, he enjoys immunity from arrest, and he is believed to have wanted to go abroad before stepping down to avoid the possibility of being detained.

But midnight passed with no announcement he had stepped down.

Factfile on the political turmoil in Sri Lanka.
Factfile on the political turmoil in Sri Lanka. AFP / STAFF

In his absence he named as acting president Prime Minister Ranil Wickremesinghe, whose own office was soon afterwards mobbed by thousands of demonstrators demanding both officeholders should go.

"Go home Ranil, Go home Gota," they shouted.

Tear gas and water cannon fired by police and the declaration of both a nationwide state of emergency and a curfew failed to disperse them and the crowd poured into the building.

Rajapaksa is accused of mismanaging the economy to a point where the country has run out of foreign exchange to finance even the most essential imports
Rajapaksa is accused of mismanaging the economy to a point where the country has run out of foreign exchange to finance even the most essential imports AFP / Arun SANKAR

One protester was killed due to suffocation from tear gas, police said.

Wickremesinghe, also 73, would automatically become acting president if Rajapaksa steps down, but has himself announced his willingness to resign if consensus is reached on forming a unity government.

Sri Lanka's president left behind cash worth $50,000 when he fled his official residence, which is now drawing crowds for whom the palace would normally have been off limits
Sri Lanka's president left behind cash worth $50,000 when he fled his official residence, which is now drawing crowds for whom the palace would normally have been off limits AFP / Arun SANKAR

"We can't tear up our constitution," he said in his statement. "We can't allow fascists to take over. We must end this fascist threat to democracy," he said, adding that the state had to re-establish control over the official buildings occupied by protesters.

The protesters' actions were a repeat of the capture of the president's home and office on Saturday, when Wickremesinghe's private home was also set ablaze.

The presidential succession process could take between three days -- the minimum time needed for parliament to elect an MP to serve out Rajapaksa's term, which ends in November 2024 -- and a maximum of 30 days allowed under the statute.

Rajapaksa is accused of mismanaging the economy to a point where the country has run out of foreign exchange to finance even the most essential imports
Rajapaksa is accused of mismanaging the economy to a point where the country has run out of foreign exchange to finance even the most essential imports AFP / Arun SANKAR

Rajapaksa is accused of mismanaging the economy to a point where the country ran out of foreign exchange to finance even the most essential imports, leading to severe hardships for its 22 million people.

Earlier Wednesday, smiling Sri Lankans again thronged the corridors of the president's official residence after he flew out of the country, with young couples walking around hand in hand in a mood of quiet celebration.

"People are very happy, because these people robbed our country," said retired civil servant Kingsley Samarakoon, 74.

"They've stolen too much money, billions and billions."

But he held little hope for an immediate improvement in Sri Lanka's plight.

"How are people going to run the country without money?" he asked. "It's a problem."

Sri Lanka defaulted on its $51 billion foreign debt in April and is in talks with the IMF for a possible bailout.

The island has nearly exhausted its already scarce supplies of petrol. The government has ordered the closure of non-essential offices and schools to reduce commuting and save fuel.

The departure of Rajapaksa, once known as "The Terminator", had been stymied for more than 24 hours in a humiliating standoff with immigration personnel in Colombo.

He had wanted to fly to Dubai on a commercial flight, but staff at Bandaranaike International withdrew from VIP services and insisted that all passengers had to go through public counters.

The leader of the main opposition Samagi Jana Balawegaya party, Sajith Premadasa, who lost the 2019 presidential election to Rajapaksa, has said he will stand for the presidency.

Premadasa is the son of former president Ranasinghe Premadasa, who was assassinated in a Tamil rebel suicide bombing in May 1993.