The case of Saudi teen Rahaf Mohammed, who was granted asylum in Canada after fleeing her allegedly abusive family, is shining a spotlight on a rarely used urgent protection program for refugees in particularly dire straits.

From dramatic tweets to barricading herself inside a Thai hotel to avoid returning to Saudi Arabia, Mohammed's case drew international interest and swift action from the UN's High Commissioner for Refugees (UNHCR). It quickly deemed her a refugee in need of urgent protection.

Thai authorities, who were initially planning on repatriating her to the Middle East due to concerns over her travel documentation, provided Mohammed, 18, with temporary refuge.

The UN's refugee agency then determined she required emergency settlement.

Canada granted the UNHCR's request. Foreign Affairs Minister Chrystia Freeland personally met Mohammed at Toronto's Pearson Airport.

More than 25 million refugees worldwide are waiting for resettlement, including people fleeing war in Syria, starvation in Yemen and religious persecution in Myanmar. The Mohammed case prompts the question: Who qualifies for urgent protection? CBC Explains.

Watch the full interview with Rahaf Mohammed:

Who qualifies for urgent protection?

Technically, anyone who is outside of their home country who is likely to be killed, subjected to violence, torture, sexual assault or arbitrary imprisonment who is likely to be returned to their country of nationality or former residence, according to Canadian government guidelines.

In theory, this could potentially include millions of people. The UNHCR is the first to assess whether a person outside of their home country could qualify for urgent protection under an emergency resettlement program.

In practice, the UNHCR knows it can't be referring hundreds of thousands of people for emergency protection, as no country would accept such a high volume of cases, said Asad Kiyani, a refugee law specialist at the University of Victoria.

"They have to be very selective to preserve the agency's credibility," he said in an interview. "The UNHCR acts as a filter and screens out a lot of people who could qualify for these very pragmatic reasons."

Nancy Caron, a spokesperson for Immigration, Refugees and Citizenship Canada, said, "Individuals cannot apply directly to Canada to be considered under the urgent protection program." Referals for the "exceptional measure" must come through the UNHCR or other referal organizations, she told CBC News in an email.

The UNHCR did not immediately respond to requests for comment.

How does Canada assess emergency claims?

Cases vetted and approved by the UNHCR are then sent for consideration to about three dozen countries who have emergency protection programs.

Once the UN decides a person needs emergency protection, Canadian officials determine if candidates meet the country's internal criteria, said Laura Dawson, director of the Canada Institute at the Wilson Center, a Washington-based think tank, during testimony before a U.S. Senate committee in 2016.

Rahaf Mohammed speaks with Thai Immigration Police Chief Surachet Hakparn, right and an unidentified UNHCR officer at a transit hotel inside the Suvarnabhumi international airport in Samut Prakan province, on the outskirts of Bangkok. (Thailand Immigration Bureau/EFE/EPA)

Visa officers at Canadian consulates or embassies — essentially the same government employees who approve student or immigrant visas — make the final decision on whether a refugee qualifies for emergency protection in Canada, the law professor added.

This often happens after visa officials interview the refugee claimant to make an assessment. Usually, these embassy officers communicate regularly with senior officials in Ottawa about specific cases where emergency protection is required, he said.

What's the difference between a standard refugee and someone granted emergency protection?

When people are applying for asylum outside of Canada, three categories of claims generally determine how fast cases are processed, Kiyani said.

In an ordinary resettlement case deemed normal priority, the person applies for asylum in Canada after being vetted by the UNHCR or sponsored by a private organization, Kiyani said.

This process can take months or years. It involves security screenings, interviews with visa officials, a medical exam and an international criminal background check.

A second category — known as urgent priority — aims to have the refugee resettled in a third country within six weeks of the person making contact with the UNHCR, Kiyani said. It usually involves a person with urgent medical needs.

For emergency cases such as Mohammed's, the UNHCR aims to have the person resettled in a safe country within seven days of their first contact with the UN agency.

A Rohingya boy looks out over Unchiparang refugee camp, near Cox's Bazar, Bangladesh, on Jan. 11, 2018. More than 25 million refugees worldwide are hoping to be resettled in a safe country. (Tyrone Siu/Reuters)

Canada aims to decide on an emergency case within 24 hours of receiving the referral from UNHCR, according to the Kaldor Centre for International Refugee Law, an Australian research group. Australia, the country where Mohammed was initially planning to apply for asylum, aims to decide on an emergency case within two days of receiving the referral, according to the centre.

For emergency cases where time is short, medical exams and other security checks often happen once the person is in Canada. Canadian officials can still remove the refugee if he or she fails these tests.

Once the refugee is in Canada, the financial support available for the person is generally the same regardless of what sort of claim they originally made to get here, Kiyani said.

How many people are granted emergency protection in Canada and beyond?

Canada has a quota of 100 emergency protection cases per year, according to the UNHCR.

"Between 2010 and 2012, Canada accepted 100 emergency cases (264 refugees) for resettlement," according to Canadian government data published in 2016. This accounted for about 10 per cent of all emergency referrals worldwide, according to Canada's government.

In 2017, UNHCR referred around 5,500 refugees for urgent or emergency resettlement out of around 75,000 total resettlement referrals that year, according the Kaldor Centre, which is based at the University of New South Wales in Sydney.

Which other countries have similar programs?

Thirty-seven countries, mostly in Europe and the Americas, run refugee resettlement programs, according to UN data published in 2016. This includes Belarus, Belgium, Brazil, Bulgaria, Chile, Croatia, Czech Republic, Denmark, Estonia, Japan, South Korea, the U.S., and U.K., and Uruguay.

The majority of refugees globally, however, are hosted by developing countries. Turkey, Uganda and Pakistan are three largest hosts of refugees internationally, the UN's refugee agency said.