Nepal's former Supreme Court chief justice Sushila Karki has become the country's interim prime minister after deadly anti-corruption protests ousted the government.

Karki, 73, was sworn in during a brief ceremony, becoming the first woman to lead the impoverished Himalayan nation after a deal was reached with the protest leaders.

More than 50 people were killed in clashes with riot police during this week's mass protests sparked by a ban on social media platforms.

The ban was lifted on Monday - but by then protests had swelled into a mass movement. Angry crowds set fire to parliament and government buildings in the capital Kathmandu on Tuesday, forcing Prime Minister KP Sharma Oli to resign.

Earlier on Friday, President Ram Chandra Poudel's press adviser confirmed to the BBC that Karki would take the oath of office in the evening.

The agreement between the president and the protest leaders was reached after days of consultations. Legal experts were also involved.

Parliament is expected to be dissolved shortly, and the new government is tasked with conducting general elections within six months.

Karki is widely regarded as a person of clean image, and is being supported by student leaders from the so-called Gen Z to lead the interim government.

On Tuesday, she visited the protest site in Kathmandu where 19 people were killed in clashes with police the day before. She also met some of the injured who were being treated in hospital.

Karki was born in a family with close contacts with the Koirala political dynasty from the country's largest democratic party Nepali Congress, and later married the then leader party Durga Subedi.

However, Karki has faced controversy, including an impeachment incident during her nearly 11-month tenure as chief justice.

Nepal's army has deployed patrols on the streets of Kathmandu as the country reels from its worst unrest in decades. The protests were triggered by a government decision to ban 26 social media platforms, but they quickly reflected widespread discontent with the political elite.

In the weeks prior to the ban, a nepo kid campaign had exposed the lavish lifestyles of politicians' children and allegations of corruption.

Although the social media ban was lifted hastily on Monday night, the protests had already gained unstoppable momentum.