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 announced 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 enforced the curfew in Kathmandu and checked vehicles and people. The army in a statement said 21 suspected people had been arrested on suspicion of looting.

Bahadur Singh, former police officer said that the protest is not "totally wrong but the arson and destroying public property is wrong."

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, fuelled by rage over the deaths and accusations of political corruption.

Kathmandu resident and businessman Sandesh Pathak said that "the country is likely to take a new direction," and added that "hopefully the political parties have learnt a big lesson from all of this and that the country and citizens are above everything.”

Many young people are angry that the children of political leaders — so-called nepo kids — seem to enjoy luxury lifestyles and numerous advantages while most youth struggle to find work. With youth unemployment running at about 20% last year, according to the World Bank, the government estimates that more than 2,000 young people leave the country every day to seek work in the Middle East or Southeast Asia.

AP Video by Upendra Man Singh