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 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 said.
"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).
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".
"She is now under the sovereignty of Thailand; no-one and no embassy can force her to go anywhere," he said. "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".
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 said that her her passport was seized by a Saudi diplomat who met her coming off the flight says when she arrived in Bangkok on Saturday.
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."
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.
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.
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.
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 said 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.
Noura, the friend who is tweeting from Ms Mohammed al-Qunun's account, told the BBC they 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 believed Ms Mohammed al-Qunun's 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 said.
Noura said she was speaking to Ms Mohammed al-Qunun "every 20 minutes".
"She is terrified," she said.
Ms Mohammed al-Qunun's case echoes that of another Saudi woman who was in transit to Australia in April 2017.
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.