An 18-year-old Saudi woman who fled her family at the weekend has left Bangkok airport "under the care" of the UN refugee agency, the head of Thailand's immigration police says.
Thai immigration officials had tried to return Rahaf Mohammed al-Qunun, 18, to Kuwait, where her family is.
But she refused to board a flight on Monday and barricaded herself into her airport hotel room.
She said she feared her family would kill her as she had renounced Islam.
"My brothers and family and the Saudi embassy will be waiting for me in Kuwait," Ms Mohammed al-Qunun told Reuters.
"My life is in danger. My family threatens to kill me for the most trivial things."
Her relatives have not commented on her claims.
Rights groups including Human Rights Watch have expressed grave concerns for Ms Mohammed al-Qunun, who had travelled to Thailand for a connecting flight to Australia, where she hoped to seek asylum.
The Thai authorities said her status would be assessed by the UN refugee agency (UNHCR).
The Australian government said it would closely monitor the case, calling Ms Mohammed al-Qunun's allegations "deeply concerning".
On Monday evening local time, Thailand's chief of immigration police Surachate Hakparn confirmed that Ms Mohammed al-Qunun was "allowed to stay", and that she "left the airport with the UNHCR".
He earlier said the country would "take care of her as best we can", adding: "She is now under the sovereignty of Thailand; no-one and no embassy can force her to go anywhere.
"Thailand is a land of smiles. We will not send anyone to die."
Mr Surachate said he would meet Saudi diplomats on Tuesday to clarify Thailand's decision.
Ms Mohammed al-Qunun tweeted that her father had arrived, "which worried and scared me a lot", but said she felt safe "under UNHCR protection with the agreement of Thailand authorities".
Hey I'm Rahaf. My father just arrived as I heard witch worried and scared me a lot and I want to go to another country that I seek asylum in— Rahaf Mohammed رهف محمد القنون (@rahaf84427714) January 7, 2019
But at least I feel save now under UNHCR protection with the agreement of Thailand authorities. And I finally got my passport back🙏🏻❤️ pic.twitter.com/pQER7HDVi7
Thailand is not a signatory to the UN Refugee Convention and provides no legal protection to asylum seekers although there are more than 100,000 refugees in the country.
An injunction filed by Thai lawyers in Bangkok criminal court to stop the deportation was dismissed earlier on Monday.
How did the stand-off start?
Ms Mohammed al-Qunun says that when she arrived in Bangkok on Saturday, her passport was seized by a Saudi diplomat who met her coming off the flight.
Thailand initially said she was being deported because she did not meet the requirements for a Thai visa.
However, Ms Mohammed al-Qunun insisted she had a visa for Australia, and that she never wanted to stay in Thailand.
Saudi Arabia said the Thai authorities had stopped the young woman for "violating the law".
On Monday, police chief Mr Surachate said the Thais had been tipped off by Saudi officials, adding: "The Saudi Arabia embassy contacted the immigration police... and said that the girl had run away from her parents and they feared for her safety."
Phil Robertson, deputy Asia director for Human Rights Watch, told the BBC: "It seems that the Thai government is manufacturing a story that she tried to apply for a visa and it was denied... in fact, she had an onward ticket to go to Australia, she didn't want to enter Thailand in the first place."
How was the world alerted?
Ms Mohammed al-Qunun drew attention to her plight through social media posts over the weekend. She also gave a friend, Noura, access to her Twitter account, saying it was in case anything should happen to her.
"I shared my story and my pictures on social media and my father is so angry because I did this... I can't study and work in my country, so I want to be free and study and work as I want," she said.
Women in Saudi Arabia are subject to male guardianship laws, which mean they need a male relative's permission to work, travel, marry, open a bank account, or even leave prison.
Ms Mohammed al-Qunun wrote on Twitter that she had decided to share her name and details because she had "nothing to lose" now.
She has asked for asylum from governments around the world.
I seek protection in particular from the following country— Rahaf Mohammed رهف محمد القنون (@rahaf84427714) January 6, 2019
Canada/United States/ Australia /United kingdom, I ask any if it Representatives to contact me.
A photo appeared of her in her room as officials reportedly stood outside, waiting to put her on a flight back to Kuwait.
Why are there fears for her welfare?
Ms Mohammed al-Qunun told the BBC that she had renounced Islam, and feared her family would kill her if she was sent back to Saudi Arabia.
Freedom of religion is not legally protected in the kingdom, and people who convert to another religion from Islam risk being charged with apostasy - or abandoning their religious beliefs.
The crime is legally punishable by death - although courts have not carried out a death sentence in recent years.
The BBC World Service spoke to Noura, the friend who is tweeting from Ms Mohammed al-Qunun's account. She said the pair knew each other from an online group for Saudi feminists, and that she herself had "escaped" Saudi Arabia because she is "an ex-Muslim".
Noura says Ms Mohammed al-Qunun is a student at a Saudi university, and that she believes her father works for the Saudi government.
"Her family kept her alone in the house for - I think for more than six months - because she cut her hair," she told the BBC.
Noura said she was speaking to Ms Mohammed al-Qunun "every 20 minutes", adding: "She is terrified."
Dina Ali Lasloom, 24, was en route from Kuwait via the Philippines but was taken back to Saudi Arabia from Manila airport by her family.
She used a Canadian tourist's phone to send a message, a video of which was posted to Twitter, saying her family would kill her.
Her fate on arriving back in Saudi Arabia remains unknown.