Prime Minister KP Sharma Oli has resigned amid Nepal's worst unrest in decades, as public anger mounts over the deaths of 19 anti-corruption protesters in clashes with police on Monday.

On Tuesday, crowds set fire to parliament in the capital Kathmandu, sending thick black smoke billowing into the sky. Government buildings and the houses of political leaders were attacked around the country.

Three more deaths were reported on Tuesday. Amid the chaos, jail officials said 900 inmates managed to escape from two prisons in Nepal's western districts.

The demonstrations were triggered by a ban on social media platforms. It was lifted on Monday - but by then protests had swelled into a mass movement.

Nepal's army chief issued a statement late on Tuesday accusing demonstrators of taking advantage of the current crisis by damaging, looting and setting fire to public and private property.

It said if unrest continued, all security institutions, including the Nepal Army, are committed to taking control of the situation, effective from 22:00 local time.

While the prime minister has stepped down, it's unclear who will replace him. Reports suggest that some leaders have sought shelter with security forces.

The protests have been largely spontaneous, underpinned by an anti-corruption narrative, yet lacking organized leadership.

Inside parliament, protesters danced and chanted slogans around a fire at the entrance, many waving Nepal's flag. Others breached the building, smashing windows and spray painting anti-government messages.

The demonstrations were fueled by recent social media bans which were seen as an attack on free speech. Although the ban was lifted, the protests gained momentum targeting the political elite.

Government officials claimed the aim of the bans was to combat fake news, but young citizens criticized it vehemently. The unrest culminated when protests targeted political figures and their properties, leading to widespread chaos.

Prime Minister Oli stated he resigned to facilitate a constitutional resolution to the ongoing crises, with President Ramchandra Paudel beginning the search for a new leader.