Kakuma, KenyaStanding in front of his small hut in the Kakuma refugee camp, a middle-aged man named Danny wondered aloud whether he’d remain here forever. Danny grew up in neighboring Uganda, where he’d lived until the violence in the Democratic Republic of Congo between the military and a local militia bled across the Ugandan border. In 2012, he and his younger brother Arthur fled to this refuge in Kenya. (The names of all refugees in this article have been changed.)

Located in the parched and unforgiving northwestern county of Turkana, the camp was founded after thousands of the so-called “Lost Boys of Sudan” made their way here during Sudan’s civil war. Twenty-five years later, it is now one of the oldest refugee camps in the world, home to some 150,000 people forced to flee their homelands due to violence or dep­rivation. Few, if any, of Kakuma’s residents wish to remain. But unless conditions improve drastically in their home nations—Somalia, Ethiopia, South Sudan, and others—their only hope of finding stability and safety is to pray that they will be resettled elsewhere.

In 2014, Arthur’s prayers were answered when he was granted asylum by the Netherlands. Danny remained behind in the camp. The two brothers’ fates were split, it seems, by the fact that Arthur is gay, whereas Danny is not.

Arthur’s grant of asylum coincided with a push by international human-rights activists to help gay refugees who’d fled their home countries, only to face homophobic persecution in the very places they’d fled to. Heeding that pressure, the United Nations High Commissioner for Refugees expedited, for a time, the cases of gay refugees living in Kenya, a country that punishes acts of homosexuality with up to 14 years in prison and where homophobia often escalates into violence. More than 500 gay, lesbian, bisexual, and transgender refugees found themselves waiting in camps or hiding out in urban apartments in Kenya while they hoped to be resettled. In 2014, after the UNHCR began prioritizing them for resettlement, more than 100 boarded planes to safer havens in a matter of months.

“I was happy because I knew for him, he is safe now,” Danny said of his younger brother, who became part of that exodus. But a year and a half later, still stuck in Kakuma, Danny admitted that his happiness had turned to envy. “Maybe by now I could be somewhere,” he said, “having many opportunities.”

From Turkey to Pakistan, from Iran to Ethiopia, refugee workers are being forced to make painful choices regarding the future of more than 21 million refugees, part of a record 65 million displaced persons around the world. They must choose between political and economic refugees, individuals and families, the healthy and the sick, the elderly and unaccompanied children. They try to move those most in need of help to the front of the line for resettlement somewhere safe. But when it comes to triaging the world’s humanitarian crises, there are few humane choices.

The United Nations High Commissioner for Refugees is the international agency in charge of processing migrants’ refugee status and helping those who wish to be resettled apply for asylum. (Many countries, including the United States, also consider direct applications for asylum from people arriving by their own volition.) All over the world, UNHCR officials and other refugee workers are forced to weigh one refugee’s tragic circumstances against another’s. One of the people charged with making this devil’s choice is Inge De Langhe, a UNHCR protection officer from Belgium who’s been working with refugees for more than a decade. “We find people who really cannot survive in the camp,” she said, “and these people we try to resettle.”

From her office at the edge of Kakuma, De Langhe explained the process. First, her staff interviews new arrivals to the camp to determine whether they qualify for refugee status. Next, they inform some of these people that they’re eligible to apply for asylum from one of a number of host countries. Most of the people arriving at the camp don’t get a chance at resettlement, due to the limited number of slots. But if they do, De Langhe’s staff refers them to the relevant European or North American embassy to begin a lengthy series of security, medical, and other interviews to determine whether they’ll be admitted.

De Langhe’s ability to resettle the most vulnerable refugees depends on the willingness of wealthy nations to accept them. Each summer, representatives from the destination countries convene for a three-day conference in Geneva called the Annual Tripartite Consultations on Resettlement. There, UNHCR officials outline the people—Syrians, Somalis, South Sudanese—that the agency has housed in camps like Kakuma all around the world. In turn, the government officials announce their quotas: how many refugees their nations are prepared to take, and from which countries.

De Langhe can’t speak on the record about which nations are stepping up this year to welcome the world’s tired, its poor, its huddled masses. The United States does accept more refugees through the UNHCR than any other country—about 49,000 people in 2014, or two-thirds of the total 77,331 that the agency helped to resettle. The second-most-welcoming wealthy country was Canada, which took in about 7,000. The United Kingdom accepted just 628, France a mere 378. Japan took in 23. But the roughly 105,000 people that the UNHCR approved for resettlement in 2014 represented a fraction of the 866,000 who applied in that year alone.

A rising xenophobia in Europe may lead to even greater restrictions on the number of refugees who receive asylum there. But in the United States, the outlook for refugees has gotten worse. The Obama administration announced in September that the United States would accept 110,000 refugees in 2017, up from 85,000 the previous year. However, in his first week in office, President Donald Trump issued an executive order temporarily halting all refugee resettlement in the United States while new policies are developed, indefinitely blocking Syrian refugees, and temporarily suspending all arrivals from seven nations, including Sudan and Somalia. Trump is expected to ultimately lower the number of refugees that the United States accepts in 2017 to 50,000.

All of this makes De Langhe’s work in Kakuma resemble a perverse experiment in triage. “You could go to Kakuma and you could find reason to resettle each and every refugee,” she said. “But you cannot.”

One night in June 2014, Aahil, a 41-year-old gay man, was lounging with his partner in his apartment in Kampala when Ugandan police officers stormed in. Aahil escaped through a window, but his partner was taken to jail. After Aahil cobbled together enough money to bail his partner out, they fled Uganda on a bus to Kenya. It didn’t take long for them to discover that gay people were threatened in Kenya as well: In early 2015, men wearing face masks and brandishing pangas (a tool with a sharp blade, like a machete) broke down the door to their bare-bones apartment.

“The first person entered—I fought him,” Aahil recalled. “The second guy came with a sharp panga. He cut me here, and here, and here.” Aahil pointed to some of the wounds; they were deep and still visible. But he was lucky enough to be approved for resettlement in the United States. In 2015, Aahil and his partner boarded a flight to North Carolina.

Kenya has become home to gay refugees from many African countries, including Burundi, Ethiopia, and Congo. But the vast majority come from Uganda. Homosexuality was first made illegal by the British, back when the country was under colonial rule, but it wasn’t until the late 2000s that Ugandan Christian leaders began speaking out publicly against homosexuality. They were supported, and sometimes encouraged, by evangelical Americans who would travel to Uganda and denounce homosexuality in public gatherings or in private meetings with influential religious leaders and politicians. One Pentecostal pastor, Scott Lively, is being sued in US federal court by a Ugandan LGBTQ advocacy group that charges he incited the persecution of LGBTQ people during his visits to Uganda.

In 2013, Ugandan lawmakers passed a bill that, in its original form, would have punished “aggravated homosexuality”—including repeated gay sex or sex with a minor—with death. The Constitutional Court of Uganda invalidated the law on a technicality, but Uganda still outlaws homosexuality, as do 35 of Africa’s 53 other nations. The law became a major news item, and Ugandan newspapers began publicly outing alleged homosexuals, publishing their photos and using inflammatory headlines like Hang Them. David Kato, a well-known LGBTQ-rights activist, was murdered; many others were attacked or jailed.

Beginning in early 2014, hundreds of LGBTQ Ugandans decided to flee for their safety. Most went to Kenya, which for decades has reluctantly harbored refugees from around the region. But as Aahil learned, Kenya is no safe haven for gay refugees. When a straight man from South Sudan flees the war and arrives in Kenya, he may be forced to live under miserable conditions in a refugee camp, but at least he’s managed to escape the conflict. When LGBTQ people arrive in Kenya, they haven’t escaped the persecution that drove them here.

That’s why the UNHCR in Kenya decided to give LGBTQ refugees priority for resettlement. The agency frequently does this for individuals who face unique dangers, but prioritizing an entire class of refugees for resettlement based on their sexual identity was unprecedented. In conjunction with Kenya’s Department of Refugee Affairs, the UNHCR began to expedite many LGBTQ Ugandans for resettlement, sending them off to Europe or North America within just six or seven months’ time.

Still, even priority status isn’t enough to ensure resettlement, given how few slots are open. Within a year, it became impossible for the UNHCR to prioritize the hundreds of LGBTQ people arriving in Kenya. The speedy processing stopped; the later arrivals have had to wait. But waiting means living in a camp like Kakuma surrounded by other refugees, many of whom disparage homosexuals, or hiding out in Nairobi in violation of Kenyan law, which requires all refugees to remain in the camps.

On a hot Saturday in October 2015, a woman named Grace sat inside a dark mud hut in Kakuma. A bisexual mother of two, Grace owned a boutique in Kampala, Uganda, where she sold dresses and other clothing for children. She lived with her husband until one day in April 2014, when he went looking for his passport and found hers instead. From between its pages fell nude photos of Grace and a girlfriend she’d been seeing in secret. Grace said her husband shouted at her and beat her. Then he called the police.

“He told the police that he has been with me for a long time and he didn’t know I was a lesbian,” Grace recounted. “He was wondering why I wasn’t making love to him for a year, and he realized that was the reason.” The police took Grace to jail, and her husband told her never to return. After a few nights in jail, Grace’s cousin came and bribed the police to let her out. Grace retrieved her two young children and boarded a bus to Kenya.

A few weeks after arriving at Kakuma, Grace’s 4-year-old son asked her when they would leave. Grace didn’t have an answer. Returning to Uganda wasn’t an option: After they’d fled, a newspaper in Kampala outed Grace as a lesbian and published a picture of her. She keeps the newspaper clipping in her wallet. After the photo appeared, Grace heard from her sister in Kampala that people had vandalized and looted her boutique. With no livelihood to return to, she’s been waiting to learn whether she and her two kids will be among the lucky few chosen to be resettled somewhere new. Meanwhile, she’s faced violence in the camp, too: The bushes that formed a fence around the compound she shares with other LGBTQ refugees have been burned, presumably by homophobic refugees who find their presence unwelcome.

To determine if someone is eligible for asylum, the UNHCR interviews that person to look for evidence that she has experienced “a threat to life or freedom” sufficient to justify her decision to flee. Technically, a person doesn’t need to prove that she has experienced persecution already; a well-founded fear that she would be persecuted if she were deported back to her home country is sufficient. For an LGBTQ refugee coming from a country where homophobic abuse is well documented, this standard is easily met.

But in most other respects, Grace’s predicament is little different from that of hundreds of thousands of straight and cisgender refugees in Kenya. This becomes immediately clear to anyone who enters the “protection area” of Kakuma Camp 3. It’s a fenced-in sector where refugees who face particular persecution or threats are moved for their safety. They are advised not to venture beyond the fence without a police escort, which is usually only provided when they have a UNHCR or embassy appointment to attend. The rest of the time they live inside a small prison of sorts, until the day they’re resettled— a day that, for most of them, will never come.

One of these refugees is Keicha. A straight woman with wide eyebrows and fingernails painted dark pink, she lives in the protection area with her husband and three sons. Years ago, a soldier in Congo shot her father in the head and then kidnapped Keicha as his wife. After a year of domestic enslavement, she escaped and eventually made her way to Kakuma in 2009.

Keicha found a job as a midwife at the camp hospital. She says one day a Somali man stopped her and demanded that she bring him placentas from the hospital to sell, presumably for some sort of medicinal potion. Keicha refused. One night on her way to work, five men attacked her, dragged her into a hut, and gang-raped her. Then they took knives to her uterus. “They cut off my vagina so I’m no longer a woman,” she said.

Saving her life required intensive surgery. Keicha spent more than a month in a hospital recuperating. When she returned to Kakuma, she and her family were moved to the protection area. In 2011, her family’s asylum application was rejected; no explanation was given. (The UNHCR doesn’t comment on individual cases.) Keicha said she appealed the decision but never heard back. Refugees have just 30 days to file an appeal, and it’s highly unlikely that her appeal would still be under way after five years.

Why should Keicha be forced to stay in a violent refugee camp while gay Ugandans get resettled in North America and Europe? De Langhe sympathizes with the LGBTQ refugees’ plight—but she also sympathizes with the 500,000 other refugees living in Kenya. Which ones among them most deserve a rare chance at a new life, and which should be left behind in a squalid refugee camp? One official working on refugee resettlement for a foreign embassy in Nairobi described the triaging of gay and straight refugees as “Solomonic,” adding: “There’s a lot of really ugly stuff that goes on in the world.”

So for refugee workers like De Langhe, there are no good choices. Because wealthy nations don’t admit anywhere near the number of refugees who need protection, prioritizing Africa’s gay refugees comes at the expense of others: people like Keicha, women who have been victimized by sexual violence, and her children. (In Kakuma, about half of all refugee claims include minors.) Then there are the orphans—children whose parents were killed in the wars from which they fled. There are elderly refugees and disabled ones, too.

“You meet with LGBTI and you think, ‘Oh, I have to prioritize them,’” De Langhe said. “Then you see the children and you think you have to prioritize them. Then you see the old people…. That is the dilemma.”

Read Next: Daniel fled Eritrea in 2008. It took him 6 years and a journey through 8 countries before he reached safety in Europe.