An 18-year-old Saudi woman who feared death if deported back home has arrived in Canada to start a new life.
Rahaf Mohammed Alqunun was described as a "very brave new Canadian" on arrival by the country's foreign minister.
Ms Alqunun made an international plea for asylum after claiming she was abused by her family.
The teenager fled her relatives during a trip to Kuwait and flew to Bangkok, where she refused to leave Thailand - barricading herself in a hotel room and starting a social media campaign.
Prime Minister Justin Trudeau had said Canada would accept Ms Alqunun as a refugee.
"That is something that we are pleased to do because Canada is a country that understands how important it is to stand up for human rights and to stand up for woman’s rights around the world and I can confirm that we have accepted the UN's request," Mr Trudeau said.
Standing with Ms Alqunun by her side at Toronto's airport on Saturday, foreign minister Chrystia Freeland said: "This a very brave new Canadian."
She added that Ms Alqunun had had "a very long and tiring journey".
The teenager earlier tweeted two pictures from her plane seat - one with what appears to be a glass of wine and her passport and another holding her passport while on the plane with the hashtag "I did it" and the emojis showing plane, hearts and wine glass.
Several other countries, including Australia, had been in talks with the UN’s refugee agency to accept Ms Alqunu/
Canada's decision to grant her asylum could however upset the country's relations with Saudi Arabia.
Canada's ambassador had seen her off at the airport.
She thanked everyone for helping her and added that the first thing she would do upon arrival in Canada would be to start learning the language.
She already speaks more than passable English, in addition to Arabic.
The office of the UN High Commissioner for Refugees welcomed Canada’s decision.
"The quick actions over the past week of the government of Thailand in providing temporary refuge and facilitating refugee status determination by UNHCR, and of the government of Canada in offering emergency resettlement to Ms Alqunun and arranging her travel were key to the successful resolution of this case,” the agency said in a statement.
It was not immediately clear what prompted Ms Alqunon to choose Canada over Australia.
Australian media reported that UNHCR (United Nations High Commissioner for Refugees) had withdrawn its referral for Ms Alqunon to be resettled in Australia because Canberra was taking too long to decide on her asylum.
Australia’s education minister Dan Tehan said on Saturday that Australia had moved quickly to process her case but Canada decided to take her in.
He added that, ultimately, the outcome was a good one. "She’s going to be safe," he said.