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.

The 73-year-old was sworn in during a brief ceremony, becoming the first woman to lead the impoverished Himalayan nation after a deal was reached with 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 had confirmed to the BBC that Karki would take the oath of office that evening. The agreement between the president and the protest leaders was reached after days of consultations. Legal experts were also involved.

Parliament was dissolved late on Friday and it was announced that general elections would be held on 5 March next year. Karki is expected to appoint ministers to her cabinet within a few days.

She is widely regarded as having a clean image, and her leadership of the interim government is being supported by student leaders from the so-called 'Gen Z' movement.

But her cabinet will face multiple challenges, including restoring law and order, reconstructing parliament and other key buildings that were attacked, reassuring the Gen Z protesters who want change - and others in Nepal who are fearful its young democracy and constitutional order could be derailed.

Karki's appointment is a compromise resulting from talks that were brokered by Nepal's army chief this week. Elated Gen Z supporters are expressing their happiness on social media, and many see this as the next step in the new political course they want the country to take.

On Tuesday, Karki 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.

The new PM was born into a family with close ties to the Koirala political dynasty, from the country's largest democratic party Nepali Congress, and later married the then-leader Durga Subedi. She has credited her husband's support as a major influence in her professional ascent from a lawyer to Nepal's chief justice in 2016.

However, Karki has faced controversy, including an impeachment incident during her nearly 11-month tenure as chief justice. Meanwhile, the army is maintaining a presence on the streets of Kathmandu as the country navigates its most severe unrest in decades.

The protests were initially triggered by the government's decision to ban 26 social media platforms including WhatsApp, Instagram, and Facebook but soon grew to encompass broader dissatisfaction with Nepal's political elite.

As Karki steps into this pivotal role, her administration's immediate focus will be on restoring order, addressing public concerns for justice, and preparing for upcoming elections amidst a backdrop of political upheaval.