Amid the country’s economic crisis and resulting anti-government protests, Sri Lankan President Gotabaya Rajapaksa on Friday declared a state of emergency effective Friday midnight, giving his security forces sweeping powers , reported the PTI news agency.

The decision came amid weeks of public protests demanding the resignation of the president and the government. According to the presidential media division, Rajapaksa’s decision was aimed at ensuring public safety and maintaining the flow of essential services resulting in the smooth functioning of the country.

Earlier in the day, Sri Lankan police used tear gas and water cannon to disperse students protesting outside parliament, blaming lawmakers for failing to overthrow President Gotabaya Rajapaksa and his government. The student-led protest began on Thursday after a government-backed vice president was elected to parliament by a decent margin.

Sri Lanka is experiencing the worst economic crisis in its history, characterized by a shortage of basic necessities and power outages caused by a severe currency crisis.

Rajapaksa previously declared a state of emergency on April 1 after a mass protest outside his residence. He then revoked it on April 5.

The state of emergency gives the security forces and the police the power to arbitrarily detain and even arrest people.

–With PTI, AP inputs