On October 23, 2016, a 23-year-old Ugandan woman named L. took her girlfriend to a small hotel. While they were making love there, their lives changed forever, and they nearly died.

L. got a visa, and fled to the United States. But Customs and Border Protection officials wouldn’t let her in. Today, they refuse to reexamine her case –– despite the fact that she has survived beatings, torture, and a “corrective” rape ordered by her own father.

For safety reasons, we will use initials –– L. and E. –– to refer to the woman and her girlfriend. The story below is based on conversations with L. and her attorney, as well as court filings, photos, and medical documents that L.’s attorney showed The Daily Beast.

L. grew up in a small community in the southern part of Uganda. In high school, she and E. fell in love. For more than five years, they kept their relationship a secret. In Uganda, as in much of sub-Saharan Africa, being gay means living in secret, or living in danger; it can mean choosing between safety and love. L. and E. chose love, and it almost killed them.

When the two women got to the hotel, they didn’t lock the door. Then a group of men barged in.

“We were naked and we were making love,” L. said.

The men dragged them out to the street, and began throwing stones at them and beating them. The crowd swelled with onlookers. Then the attackers poured paraffin gas on both women. Some started looking for old tires.

“They were planning to burn us,” L. said.

Before that could happen, the police showed up. They arrested both women, took them to jail, and charged them with immorality. While they were incarcerated, L. and E. couldn’t communicate. The police beat and tortured them. Their parents urged them to beat them, according to L., “so that we could get upright, so we would not go back and think about the same act.”

In Uganda, sex between two men or between two women is illegal. The law’s origin dates back to the British colonial era, when so-called buggery was banned. As Human Rights Watch has detailed, Uganda inherited this law from the British, and its lawmakers made penalties even harsher in 1990, and harsher still in 2014 –– up to life in prison. In the years since then, activists say that harassment and assault of transgender, lesbian, bisexual, and gay people in Uganda has intensified.

The women were released after a few days, and ordered to report to police regularly. They moved to a big city, hoping to finally be safe. They weren’t. L.’s father recruited a man who stalked her and send her threatening messages.

On November 4, when E. was away, the man broke into their new home and raped L.

The practice of corrective rape is not infrequent in sub-saharan Africa. Tarah Demant of Amnesty International said it’s most prevalent in Uganda, South Africa, and Zimbabwe, as well as India and Jamaica.

“The prevalence is highest in places where there had been colonial anti-LGBT laws first,” she said.

Corrective rape is what L. survived.

“The plan was to impregnate her and thereby ‘cure’ her of her homosexuality,” reads a court filing. “ ​She went to the police to report the rape and instead of helping her, they arrested her on charges her family had lodged against her relating to sodomy and recruiting young people into homosexuality.”

L. spent two more days in jail, where police beat her again.

“You’re outcast,” she said, of being gay in Uganda. “You’re a disgrace to your family and the community.”

L. decided to flee. She has a cousin in Seattle, Washington. So she obtained a valid student visa and flew to Dulles Airport.

When she landed at Dulles on August 25 of this year, Customs and Border Protection (CBP) officials searched her things. They found that she had a ticket for a flight to Seattle, and told her they believed this meant she had lied to obtain her student visa. A CBP officer pulled L. aside for questioning, and she was terrified.

“I tried explaining, but I wouldn’t let her know my issues back in Uganda,” L. said. “I had never opened up to any officer or any other person on the experience I had in Uganda. I felt I couldn’t open up to anyone. I wanted to talk to her, but I felt I couldn’t.”

In a state of panic, L. told the CBP officer that she wasn’t afraid to return to Uganda, and that the officer’s claims that she had lied to get the visa were correct. L. has since been diagnosed with PTSD.

In the meantime, L.’s cousin got in touch with Hassan Ahmad, an immigration attorney from Northern Virginia. Ahmad faxed a letter to airport authorities saying that her family (meaning, her cousin) had retained him to represent her; that she had been traumatized in her home country; and that she would be in grave danger if CBP sent her back to Uganda. He asked that she receive what’s called a credible fear interview –– the first step to being granted asylum in the U.S.

CBP officials were unmoved, and wouldn’t let him talk to her.

“Your request has been received, reviewed, and we're not going to be able to honor​ ​it,” the Dulles CBP supervisor, Chief Sandra DeBevoise, told Ahmad, according to court filings.

A CBP spokesperson told The Daily Beast that the agency has no plans to revisit that decision.

“When asked by Customs and Border Protection officers, this traveler declined the opportunity to apply for political asylum, and denied any fear of returning to her home country,” the spokesperson said, noting that L. also told the officer at the airport that she had not come to the U.S. as a student.

People who tell CBP officials when they arrive in the U.S. that they are seeking asylum receive special protection. But L. didn’t know this would be the case for her. It’s not unheard of for refugees like her –– fleeing persecution over their sexual orientation or gender identity –– to face the same paralyzing fear.

“I have no doubt that there are people who have come and have been unable to express their fear,” said Jennifer Quigley, Advocacy Strategist for Refugee Protection at Human Rights First.

She added that conversations with CBP pose unique challenges for LGBT people from repressive countries, many of whom –– like L. –– have spent their lives working to keep law enforcement figures from ever finding out that they are gay.

“There is no way this is an isolated incident,” Quigley said.

The CBP officials revoked L.’s visa and ordered her removed from the U.S. She stayed in the airport overnight, and then was put on a flight back to Uganda.

She didn’t want to go back. So when her flight landed for a layover in the Dubai International Airport, she hid in a bathroom stall. The flight to Uganda left without her. From her hideout, she texted her cousin and Ahmad.

“Hassan told me I should keep calm, he’s getting in contact with the UN,” L. said.

Ahmad is part of the Dulles Justice Coalition, a volunteer group of attorneys formed in the wake of President Donald Trump’s first travel ban. They try to help people like L. who have trouble with CBP.

So Ahmad became L.’s attorney, and he called officials with the UN High Commission on Refugees about her situation. The UN told officials with the Emirates airline –– the airline whose flight L. had missed –– about her situation.

“They wrote to the Emirates people in Dubai in the airport and told them I was there for some time and they would figure it out,” she said.

L. couldn’t come to the United States and couldn’t go back to Uganda. So she stayed at the airport, sleeping on chairs in the lounge area.

“It was cold,” she said. “The air conditioning –– it was too much.”

People from the UN brought her clothing, money, and toiletries.

“The UN people are amazing people,” she said. “They tried their best to help me.”

She befriended a mother and her daughter who were also stranded in the airport; they had been deported from Malaysia back to Dubai, but had visa problems.

After two weeks, they arranged for her to stay in an airport hotel. She lived there for another two weeks. Finally, she got travel papers to go to Kenya, where homosexuality is also illegal.

And now, she’s stuck.

Her attorney, Ahmad, is trying to get her into the U.S. CBP has said they won’t reverse their decision to order her removed, even after looking at all the material her attorney shared with The Daily Beast.

“L. is still fighting, and so are we,” he said.