KATHMANDU, Nepal (AP) — Armed soldiers guarded the streets of Nepal’s capital Wednesday, ordering people to stay home in an attempt to restore order after tens of thousands of protesters stormed and set fire to government buildings and attacked politicians.

Soldiers with weapons guarding the main areas of Kathmandu appeared to give some sense of control returning to the city that was overtaken by violence and chaos in previous days.

The army warned in an announcement late Tuesday that the security forces were committed to preserving law and order. The army is rarely mobilized and so far had stayed in its barracks, but police have failed to control the situation.

Soldiers told people in Kathmandu that the curfew was valid and checked vehicles and people. The army in a statement said 21 suspected looters had been arrested.

The protests had grown increasingly violent Tuesday as demonstrators set fire to government buildings and politicians’ homes and attacked some leaders. The prime minister resigned amid widening criticism of the country’s political elite, though it appeared to have little effect on the unrest.

Tens of thousands of protesters remained on the streets late in the day, blocking roads and storming government facilities. Army helicopters ferried some ministers to safe places.

On Monday, demonstrations led by young people angry about the blocking of several social media sites gripped the capital, and police opened fire on the crowds, killing 19 people.

The social media ban was lifted Tuesday, but the protests continued, fueled by rage over the deaths and accusations of political corruption. President Ram Chandra Poudel appealed to the protesters to pursue a peaceful resolution and stop further escalation, accepting the resignation of Prime Minister Khadga Prasad Oli and appointing him to lead a caretaker government.

The demonstrations — called the protest of Gen Z — began after the government blocked social media platforms, including Facebook, X, and YouTube, saying the companies had failed to register and submit to government oversight.

However, the protests spiraled to reflect broader discontent. Many young people are upset that the children of political leaders enjoy luxurious lifestyles while the majority of youth struggle to find work. With youth unemployment around 20% last year, many young people leave the country daily to seek opportunities abroad.

Videos shared on social media showed protesters clashing with politicians, including attacks on Nepali Congress party leader Sher Bahadur Deuba. Smoke was still rising from damaged government buildings on Wednesday, and protesters blamed the government for police violence.

The violence unfolded as Nepal’s government pursues a bill to regulate social media more strictly, a move seen by critics as an attempt to curb freedom of expression. This political unrest in Nepal continues to unfold as the youth express their frustrations against the elite and government policies.