People visit the President's house after President Gotabaya Rajapaksa fled, amid the country's economic crisis, in Colombo, Sri Lanka on 13 July, 2022Reuters

Crisis-hit Sri Lanka declared an indefinite nationwide state of emergency on Wednesday, hours after president Gotabaya Rajapaksa fled the country, the prime minister's office said.

"Since the president is out of the country, an emergency has been declared to deal with the situation in the country," Dinouk Colombage, spokesman for prime minister Ranil Wickremesinghe, told AFP.

Police said they were also imposing an indefinite curfew across the Western Province, which includes the capital Colombo, to contain growing protests after Rajapaksa flew to the Maldives in a military aircraft.

Thousands of demonstrators had mobbed the premier's office, prompting police to fire tear gas to hold them back from overrunning the compound.

"There are ongoing protests outside the prime minister's office in Colombo and we need the curfew to contain the situation," a senior police officer told AFP.

He said they were under orders to crack down against demonstrators disrupting the functioning of the state.

Tens of thousands of men and women overran Rajapaksa's official residence on Saturday, forcing him to escape to a military base and later flee the country.

Officials said he had promised to resign on Wednesday.