After my meeting with Michael Bashaija in July 2015, I dropped him on the Ngong Road to get a matatu (minibus) back to where he lived, outside the city, in a communal house with 20 other refugees. I watched him tuck his long braids back into his red beanie and marshal his slight frame – which looked even skinnier in his tight green jeans – into the more masculine step of the street. He arranged his eloquent features into a blank rictus and disappeared into the rush-hour throng.

If asked a question by someone else in the matatu he would try to mutter something in Swahili, he told me, even though this was a language he still barely spoke. If he answered in English, he would be identified as a foreigner. If it was a policeman, he might be asked to show his papers. And that is “when the trouble will begin”, he said. “There’s no war in Uganda, so when someone sees that I am asylum seeker here, they know there can only be one reason.”

A few hours earlier, I had watched Bashaija pull the beanie off and shake out his braids, parted in a line along the top of his crown so that they fell down the sides of his head to make a heart of his fine-boned face. I had not seen him in a year, and I noted immediately how he was both more feminine and more assertive than the shy and composed boy I had met in the Ugandan capital of Kampala. There was something in his manner, even in the way he threw his tote bag down in rage and frustration, that told me he had stepped into himself since I had seen him last.

Just 19, he had been in Nairobi for six months, seeking asylum from the Kenyan government on the basis of his sexual orientation. He had come to meet me straight from the United Nations high commissioner for refugees (UNHCR), because he needed new documentation. This was because his papers had been torn up by the Kenyan police when he had refused to pay a bribe. At first, he told me, the UNHCR guards had mocked him and denied him entry: “You Ugandans are bringing sin to Kenya!” When, finally, he had been granted access, he was told he would have to repeat his refugee eligibility interview.

This had thrown him into a panic. “They don’t believe me, that I’m a real LGBTI. I know it. They must think I’m one of the fraudsters.”

Initially, Bashaija had been told to come back for his refugee status determination in November: if found to be eligible, he would receive an “alien card” from the Kenyan authorities, which would give him more protection and enable him to work, and to begin the process of applying for resettlement to a gay-friendly country such as the United States. Now this path seemed unclear. He was consumed with anxiety: “I don’t think I can make it here. Let me go back to Uganda to die.” It was a teenager’s plea, a threat, a cry for help. “It’s better than staying here. Nobody cares for me here.”

I had first met Bashaija a year previously, in June 2014, when he was still in Kampala, the day before he was to go to court to testify against a man who had entrapped him via Facebook, extorted him, beaten him up, and tortured him sexually. The attack had happened just after Uganda’s president, Yoweri Museveni, had signed the country’s Anti‑Homosexuality Act into law. Two years before that, while the campaign to get the law passed was in full throttle, Bashaija had been thrown out of his home, aged 15. I had been struck immediately by how carefully and thoughtfully he spoke. He told his story dispassionately, the way traumatised people often do, as if he were looking at his violated self from far away.

There was no doubt that Bashaija’s life had been extremely tough in Uganda. But he had been drawn to Kenya by what the UNHCR itself has admitted was a “pull factor for young Ugandans”. In December 2013, the first 23 LGBTI refugees presented themselves at the Kakuma refugee camp, in the arid north of the country, after the Ugandan parliament passed the Anti-Homosexuality Act. Usually refugee resettlement to a third country takes between three and five years, but the UNHCR saw immediately how vulnerable this population was at Kakuma. And so it streamlined the process to an unprecedented six months: by mid-2014 the 23 were in the west, mainly in the United States. When a second group of Ugandan refugees protested against the conditions at Kakuma, the UNHCR decided to allow them to live in Nairobi and to give them financial assistance of 6,000 Kenyan shillings (£41) a month, in lieu of the shelter and food they would have received at Kakuma.

The agency was quickly overwhelmed with applicants, even after the Ugandan constitutional court nullified the Anti-Homosexuality Act on procedural grounds in August 2014. A year later, there were 500 Ugandan LGBTI asylum seekers registered in Kenya, but the UNHCR and its service partners estimated that at least a hundred of these were fraudulent: the agency had been alerted that a busload of new applicants had been told by their traffickers to play the gay card. Other applicants were still living in Uganda, popping over at the beginning of each month to receive their assistance.

The UNHCR put the brakes on and reverted to its standard procedures. Now hundreds of refugees expecting quick resettlement found themselves stuck in Nairobi, a place where things are often as tough for LGBTI people – in terms of prevailing social attitudes – as they were back home. To complicate matters further, the Ugandan LGBTI refugees did not have already-existing expatriate communities to slot into, to provide them shelter and employment, the way, for example, Somali or Eritrean refugees do. And the reason for their having been persecuted in Uganda in the first place was linked, in many cases, to their very inability to fit in, to their gender nonconformity.

The refugees were young, urban, educated, and fully aware of their rights. Unlike Somali or Congolese villagers fleeing war, they had left their home country with the clear understanding that these rights had been violated and with the expectation that they would be respected elsewhere. But in Nairobi, they found a society at least as intolerant as the one they had fled.

When I came to the city in July 2015 to meet Bashaija and his fellow refugees, I found aggrieved and dissatisfied young men (there were a handful of women too), seemingly unable and unwilling to integrate into Kenyan society. Even Nairobi’s own LGBTI community viewed them with suspicion: one Kenyan friend referred to them contemptuously as “professional gayfugees”. Word was out: they were hustlers, and trouble.

The house Bashaija lived in was run by a Ugandan LGBTI refugee group named Ark Communes, and sat about 30km outside of Nairobi. To get there, you had to turn off the main road at the local bar and general store, then bump down a steep dirt track to a steel gate in a high cinderblock wall. When I visited in July 2015, the house was aging and somewhat decrepit. There was a netball pitch cleared in the dust and a big old couch on the veranda, leaking its upholstery. The house had no running water or oven – cooking was done on an open fire in the kitchen – and a few pieces of mismatched furniture were scattered about. At the entrance, a list of house “officials” was neatly tacked up: the gay Ugandan cleric who had founded the project, Father Anthony Musaala, was the “president”, and Bashaija was the “deputy minister for education”. Also posted was a daily schedule and a list of rules and regulations, alongside the punishments for infringing them: the fine for not maintaining “self-discipline and presentability at all times” was 500 shillings; the penalty for spending the night in someone else’s bed without permission was to fetch five jerry cans of water.

At the time I visited there were 20 residents in the house, some sharing bedrooms, some in the double garage or in outdoor storerooms. A few rooms had signs of settlement – carefully made dividing curtains, photographs on a mantelpiece, neat racks of clothing – but most reflected the transience of their inhabitants. Bashaija’s room, a pantry off the kitchen, was dark and sparse: there was a mattress on the floor and a padlocked duffle bag beside it. I had brought provisions, and as George, Bashaija’s boyfriend, supervised a lunch team, the other residents gathered in the communal area to tell me about their lives.

The young refugees had left home knowing their rights had been violated, and that they would be respected elsewhere

Frank, the laconic matinee-idol director of Ark’s dance troupe, had collapsed recently – the result of high blood pressure that he could not afford to treat. He had had to flee a hospital when the attending doctor realised he was gay and threatened to call the police. Mo, an articulate professional, was one of the more recent arrivals at the Ark house. He had been forced to leave the place he was staying in a week before, when it had been surrounded by a mob that had discovered the residents were homosexuals.

The Ark house had begun to arouse the suspicions of the neighbours. In response to a wave of terrorist attacks in June 2014, for which the Somali militant group al-Shabaab claimed responsibility, and a further influx of Somali refugees from the north, Kenya’s new president, Uhuru Kenyatta, had initiated a programme named Usalama Watch. All Kenyans were to get to know their neighbours, 10-deep on either side of their homes, and to report anyone they did not know to the authorities. Inevitably this triggered xenophobia and made life even more difficult for the Ugandans. A complaint was lodged about the Ark house’s residents, and the police came to investigate. The residents had insisted they were political refugees, as they had been coached to do by the UNHCR, but both neighbours and authorities were unconvinced.

This dissembling created an almost impossible dilemma for the Ugandans. “On the one hand, we are told to keep a low profile, and even lie about why we are here,” Bashaija said. “But on the other hand we’re told we need to integrate into Kenyan society. How is it possible to do both?”

A member of the embattled gay community in Uganda’s capital Kampala. Photograph: Edward Echwalu/Reuters

The group was still smarting from a message that they had been given in a UNHCR communication a few weeks previously: “It is essential for LGBTI persons in Kenya to act in an inconspicuous and discreet manner for their own security … It is therefore of utmost importance that applicants keep a low profile.” Bashaija was trying hard to “go on the down-low” and to check his instincts to “gay it up”, he told me. “But nature obeys no law.”

Frank had had to flee a hospital when the attending doctor realised he was gay and threatened to call the police

Bashaija’s mentor at the communal house was a man in his early 40s, a primary school teacher named Joseph, who had been fired from his job when his sexuality was revealed. “Michael is my daughter,” Joseph told me. “Since he has come to Nairobi, he is so much more comfortable with himself. He is realising that he is not gay, but actually transgender. That is why he gets slapped so often in the streets, for walking girly.”

Bashaija agreed with this assessment, and had even chosen a female name for himself. But this would have to wait until he was resettled in the west, he told me. For now, he needed to hold his femininity in check if he was going to survive.

Why, then, did he get the braids?

“I did it because, huh! I just felt I needed to be myself. In Uganda there were rules, but here I’m independent. No one can tell me, ‘Don’t do this, don’t dress like that, Michael don’t braid your hair.’”

He needed the braids and he needed the beanie, the former as part of his process of self-actualisation and the latter to keep that very process in check, given where he found himself. It would be a difficult balancing act for anyone to maintain, let alone an impetuous 19-year-old who was just discovering his agency in the world. He had left Uganda on a journey towards being himself, after a violent and oppressive adolescence where his very survival was at risk because of who he was. His crossing the border to Kenya was the first step towards this imagined freedom, to the life that he believed awaited him in the US. And he was living with a group of other people with exactly the same expectations. How, in such a context, do you temper such expectation? How do you gather up your hope, particularly after such abjection, and pile it back into the beanie?

“I will tell you, Mark, my problems began with love.”

This is how Bashaija began his story when we first met in Kampala. His lover – a classmate – had drunkenly revealed their relationship in early 2012, at the height of the government’s campaign to outlaw homosexuality, which was aided and abetted by the tabloid press and the church. Bashaija’s father was a soldier, his mother an evangelical pastor. They banished him from church, and his father sent the military police over to rough his son up. He was forbidden to be in the presence of his siblings in case he “infected” them. When he asked for school fees, his father sneered, “Go and ask those people who taught you homosexuality to pay your tuition.”

His family stopped feeding him, and so he left, making his way to Kampala. A stranger found him weeping at the bus station and gave him a live-in job, but he was let go after a month. On the streets again, he fell in with a Christian crusade that took him in and put him up at their church’s school, the Destiny boarding primary school. At the end of the year, the pastors took Bashaija home, and his drunk father confronted them with a panga (machete) and the words: “Are you the ones who are teaching my son homosexuality?”

Discovering the reason why Bashaija was on the streets in the first place, the Destiny Boarding School decided to put him back there. When my Ugandan researcher, posing as a concerned fellow Christian, contacted the school’s head pastor, Evah Mugerwa, via Facebook, the pastor explained, “We could not be with someone who was a gay person; there was fear that he will spread it among other students.” When my researcher gently reproached her, the pastor shot back, “Why would a born-again Christian even think that we did something wrong to let a homosexual go?”

Through his first job, Bashaija had saved enough to buy a smartphone, and this keyed him into Kampala’s gay community. “It was Facebook that saved me, and Facebook that hurt me,” he told me. He hooked up with a series of dodgy benefactors, including one man who pimped him. Eventually he was taken in by a gay student activist named Apollo, who would follow him into exile in Nairobi.

In early March 2014, Bashaija received a friend request on Facebook from a man who said he had been moved by the story posted on his wall and wanted to help. The man asked him to come to his home, where he said he would document his story. When Bashaija arrived, he was led into a bedroom where, he told me, he was confronted by “a gay guy, stripped naked on the floor, being kicked and beaten by two other men”. Bashaija was held there for about eight hours: during this time he was told to masturbate with cooking fat mixed with red pepper, he was urinated on, he was burnt with hot water, he was tied up, he was kicked and beaten to the point of coughing blood, and he was forced into sex with a third hostage. “All the time they were asking me, ‘Who made you gay?’, ‘Why are you gay?’, ‘Who paid for you to be gay?’”

The assailants took Bashaija’s wallet and his phone. He told them he could get them more money, and they released him. He found Apollo, who took him to a clinic for treatment and then – with the help of an LGBTI organisation – to the police station to lay charges. There, in the hours just following his assault, he encountered one of his assailants, who had been identified by one of the other victims and brought in by the police.

He was led into a bedroom where 'a gay guy, stripped naked on the floor, was being kicked and beaten by two other men'

The process of reporting his attack traumatised Bashaija further. The police officers shouted at his lawyer – “You human rights organisations are helping gays” – and he feared reprisals once his assailant was released on bail. Indeed, about a week later, a group did arrive at Apollo’s door. “We will deal with you, we know what you do, we’ll hunt you down,” they said. Bashaija became paranoid on the street, worrying that someone was following him.

With the financial help of Apollo and others, he enrolled at a boarding school and got out of Kampala, coming back whenever he was needed to testify in court. His assailant was found guilty of assault and extortion, and sentenced. According to Bashaija, he was released in December 2014.

Gay and lesbian activists at Uganda’s first gay pride parade in Kampala in 2012. Photograph: Rachel Adams/EPA

That month, Bashaija left for Nairobi. He was one of about 70 Ugandans claiming asylum on the basis of sexual orientation or gender identity that month, an all-time high. He was registered, taken to a transit centre for a few days, and then collected by HIAS, an American-Jewish refugee agency that UNHCR has subcontracted to look after LGBTI refugees in Kenya.

Bashaija was given the initial financial assistance of 12,000 shillings (£83), and he found lodgings with another Ugandan refugee. But a week later, while shopping at a nearby market, Bashaija was shoved by three men: “Why you acting like a girl?” They threw him to the ground and kicked him. He returned home with bruises and a swollen eye, horrified that no one had intervened to protect him. The words of his assailants sliced through his fantasies of asylum: “Museveni chased you from your country, and now you’ve come here, also to spoil it.”

In January he moved to a more central district, in a building where many refugees lived. But a few weeks later he was arrested in a police raid on the building after neighbours lodged a complaint about a raucous party. The party was to bid farewell to a refugee who was being resettled, and Bashaija insists it was over by 8.30pm. He was woken after midnight in his room, and taken to the holding cells at the local police station along with 34 others, all Ugandans.

Bashaija had been having panic attacks since his entrapment in Uganda, and now, when the detainees seemed set to spend a second night in jail, he had one so severe that he fell unconscious. He was taken to hospital, and when he was discharged he learned that he and the other refugees could not return to their lodgings: they had been exposed, and a mob was allegedly waiting for them.

Lacking funds to find a new place to live, the refugees went to the UNHCR offices in the upmarket suburb of Westlands, but were denied entry to the building. With nowhere else to go, they staged a protest at the compound gates, sleeping there for three nights. In a remarkably eloquent appeal – drafted in part by Bashaija’s former benefactor Apollo, now also in Nairobi – the refugees demanded not only accountability from the UNHCR but to be consulted on all decisions involving them. They also wanted increased financial assistance and the reintroduction of an expedited resettlement process, given how vulnerable they were.

But things turned nasty. The Kenyan police were called in to disperse the protesters, because, the UNHCR says, they had become violent. Bashaija and his friends allege that they were compelled to sign a document stating that if they came to the UNHCR again without an appointment, their process would be stalled: this has strongly discouraged them from approaching the agency with their problems. The UNHCR insists that the document merely committed the Ugandans to refrain from violent protest. I have not been able to see a copy of it.

Out of this crisis emerged a more consultative system, with a group of leaders elected by the Ugandan refugee community to represent them. Bashaija and the others were given a few nights in a hotel while alternate plans were made. Meanwhile, Father Masaala came up with a solution: he signed the leases on two properties. There, in what he called the Ark Communes, the refugees would be safer, outside town, in big old houses on walled properties. They would also live communally, pooling their scant resources.

Bashaija moved into one of these residences to await the results of his eligibility interview. He enrolled in a computer course, but dropped out because he could not afford the transport fees. He tried to go to a driving school, but no one would take him because he did not yet have his papers. He wanted to go back to high school, but he could not be admitted because he had not brought his records with him from Uganda.

A gay rights activist in Nairobi, Kenya, at a protest against Uganda’s criminalisation of homosexuality. Photograph: Ben Curtis/AP

I was one of those who had helped Bashaija stay in school in Kampala in late 2014, after his attack. I had met him as part of the research I was doing into the new global debate on LGBTI rights and the effect it was having on different parts of the world. I do not pay informants for their stories, but very occasionally, when they are clearly in need, and when they have taken time that might otherwise have been productive to talk to me, I try to find a way of assisting them in advancing their lives. In South Africa, for example, I pay a refugee rights organisation a small monthly amount to employ a transgender refugee from Malawi once a week. Struck, here in Kampala, by Bashaija’s unschooled intellect, I felt compelled to assist when I heard there was a plan by elders in the community to get him back into education. I could not but think back to my own coming-of-age difficulties as a gay man, living in financial comfort and not rejected by my family: how could Bashaija even begin to accept himself in his current situation? I was clear, though, that I would not advise or influence him, and I was both surprised and dismayed when he contacted mein early 2015 to tell me that he had fled to Kenya.

In 2014, while he was still in Uganda, I paid $200 for him to complete Form 3. I did a whip-round with friends and gathered commitments from others for him to go further should he pass the year. Later, after he fled to Kenya, I told him that the offer to help him continue his education still stood. To tide him over during a period when the UNHCR stopped paying its financial assistance to some refugees as it investigated fraudulent claims, I made another $250 available to him once he was in Nairobi. This was meant to be for food and shelter, but, having heard from his brother through Facebook that his mother had been in a road accident, Bashaija chose to send a large part of it to her.

He told me, when we met in Nairobi, that he had pretended to his mother that he was in Kenya for work.

“Why didn’t you tell her the truth?” I asked.

“I didn’t want her to know that the money I was giving her was gay money.”

“What’s gay money?”

It was a leading question, and he got it immediately. He shot his eyebrows up in a characteristic arch and nodded his head forward, in my direction, by the slightest of degrees.

I offered the help. Neither Bashaija nor anyone else had suggested it. But as my relationship with him developed, I came to realise that I had become part of a dynamic of solidarity and dependency that is intrinsic to global LGBTI politics in these times. It is a dynamic that fuels the “recruitment” narrative of homophobia, giving tinder to the prejudices of people such as Bashaija’s father, who shouted, “Go to those people who taught you to be a homosexual for your tuition!” or like Bashaija’s assailants who demanded to know, “Who paid you to be gay?”

The Anglican archbishop of Uganda, Henry Orombi, told a researcher in 2009 that “promoting gay relationships have attracted people financially”. If “a boy needs school fees and you offer him money”, Orombi said, “the temptation is very strong”. The Ugandan ethics minister, Simon Lokodo, said something similar to a British journalist in 2014: “I am worried about recruitment, about those gays who come to our country and turn our children into homos, pay them money to become homosexuals.”

Perhaps it is easier for many traditional Christian Africans to understand homosexuality as a material relationship than to accept it as natural and perplexing human behaviour – or even as an offence against God. If my son is gay because of his desire or something innate, then the world is inexplicable. What becomes of all the church’s teachings about sin? And what will happen to the family’s bloodlines and wealth? But if my son is gay because he is needy, or greedy, it makes more sense.

Bashaija’s homosexuality is manifestly not a strategy for getting out of poverty. But perhaps it could be said that his identity as an “LGBTI” is connected to the capital this label carries in a new global economy where the wealthy west values such identities and understands them as vulnerable. Since 2008, the UNHCR has accepted “fear of persecution on the grounds of sexual orientation or gender identity” as a category to qualify a person as a refugee. And several developed nations – particularly the US and Nordic countries – have expressly committed themselves to taking in LGBTI refugees. Individuals in these countries, furthermore, have felt the solidarity-pull of conscience. As their own battles for equality have been won, they have cast their eyes elsewhere and noted, with heightened consciousness, the troubling new global equation that seems to have come into play: as these rights are confirmed in some parts of the world, they are denied, increasingly, in others.

When Bashaija found himself orphaned, in effect, the LGBTI ticket became his surest means of survival. Over time and over space, from the “Nellies” of late Victorian England to the voguing houses of Harlem or the third-gender hijra communities in India, there has been a constant to the gay, or queer, communities that develop among outcasts: alternate families form, intergenerationally, and bonds are cemented by the way people become “mothers” and “daughters” or “brothers” and “sisters”.

When Joseph claims Bashaija as his daughter in Nairobi’s refugee community, he is taking on a responsibility, but also laying claim to a relationship that he hopes will sustain him, emotionally and materially, in the absence of the family that rejected him: he will mentor Bashaija, and Bashaija no doubt will help him with the limited funds he has, as a result of the relative celebrity of his kidnapping and torture case. Likewise, when he calls me “Big Bro”, it might be an expression of affection, but it is so much more, a hankering for the family that has been lost to him – along with, of course, this family’s support, emotional as well as material.

In this digital era, where such families are virtual as well as physical, and where social media allows for a dizzy fast-tracking of intimacy, it was inevitable that Bashaija would acquire an American “father”. His name is Shane Phillips, and he is a gay born-again Christian in his late 40s. He is an itinerant construction worker who lives in Phoenix, Arizona.

Phillips told me his story through a Skype conversation in September 2015. He had been bothered by the evangelical right’s role in Uganda since hearing about it in 2009, and had felt compelled to show Africans a different face of Christianity. He set up a philanthropic organisation called One World Voice, the goal of which, he told me, was “to save more lives than anyone has on the planet, because nobody tries in the world any more”. He wanted to set up a safe space for resettled refugees in Phoenix: he offered himself as Bashaija’s “anchor host” in the US should he be resettled there, and his dream was for Bashaija to be this centre’s first resident.

Shane Phillips and Michael Bashaija. Photograph: Picasa/Facebook

Phillips became increasingly horrified by the stories he was hearing from Uganda, and the prospects of what he called, on his website, an imminent “genocide” against gays in the country. He raised $500 from a local pastor “to get a few people out” and began connecting with Ugandan networks on Facebook. “I was delivering pizzas for Papa Joe’s at the time. Every bit of extra money I made went towards getting people out of Kampala.”

Initiatives such as Phillips’s have been slammed by the leaders of the Ugandan LGBTI movement, who feel they offer impossible promises to Ugandans who then find themselves stranded in Nairobi. But Phillips counters, with emotion, that everyone he has helped personally – he estimates there are about 40 – was in a life‑and-death situation, and that many, like Bashaija, were suicidal.

Immediately after Museveni signed the anti-homosexuality bill into law in February 2014, Phillips was online, looking for people to help. He found a man whom Bashaija was staying with at the time, and sent enough money to get them both to Nairobi. But when the other man stole the money and left Bashaija in the lurch, Phillips and Bashaija began messaging each other. “When Michael told me his story,” Phillips told me, “I said to him, ‘I promise you, I’ll be a father to you for the rest of your life, no matter what it takes. I will never leave your side.’”

Phillips told me that Bashaija was one of three young men with whom he had developed such close bonds. And Bashaija does indeed talk about Phillips as a lifesaver. Certainly, as one listened to both their accounts, one heard the difficulties and strains of many father-son relationships, but Phillips was true to his word: they messaged almost daily, and had weekly scheduled conversations. They met, finally, when Phillips visited Africa for the first time in February 2015 and spent a few days in Nairobi. Both men wept, and in the photographs posted online, Phillips – bald and bulky and full of expansive American bonhomie – towers over his smiling ward.

Phillips’s material contributions to Bashaija’s welfare were small: he said he was overextended already with the support he gave to others. But when, in early December 2014, Bashaija began sending him increasingly panicky messages, stories of nightmares, and threats of suicide, Phillips felt compelled to act. “It was clear that he had to get out,” Phillips told me. “I sent him the funds for a bus fare and told him to go to Nairobi.”

Richard Lusimbo, a leader of Sexual Minorities Uganda (SMUG), the main Ugandan LGBTI rights organisation, had arranged a small relief grant for Bashaija after his ordeal. Lusimbo told me he was shocked when he heard about Bashaija’s departure. “He had, of course, been thrown out of home, and he was the victim of this terrible assault, but everything had seemed to be working since then. The police had found his attacker, and the courts had ruled against him. The community had rallied around Michael, he was back in school. His story seemed to be moving towards a positive resolution, and we need those stories to balance out the ‘Worst Country in the World for Gays’ stereotype.”

Why, I asked Bashaija, did he leave?

He confirmed that Phillips had counselled him to do so, but he insisted that, at that point, he really did have no other option. He had received the grant from SMUG, but he had felt compelled to send some of it home to his family to buy cattle, and besides, he had nowhere safe to stay in Kampala until he went back to boarding school, as he had fallen out with Apollo over money. His benefactor wanted a cut of the SMUG funding. To exacerbate Bashaija’s insecurity, he heard that his assailant had been released from jail: “I felt it was only a matter of time before they would come and get me.”

On my last day in Nairobi, I went to watch the Ark dance troupe perform at a resort in the Ngong foothills – the kind of place city dwellers with a little money to spare might drive out to for a drink and a weekend nyama choma (barbecue) lunch or a swim. Brightly painted in blues and yellows, with exclamatory Swahili slogans on the walls, it consisted of a series of open thatched pavilions set around a huge swimming pool. It was not far from one of the Ark Communes houses, and a group of the Ugandans had become friendly with the owner. Their troupe had been rehearsing to participate in a dance competition on World Refugee Day (they went on to win), and they proposed to the club’s owner that they provide entertainment on Sunday afternoons. The troupe raised funds for costumes and rehearsed diligently: they were a huge success, and the club paid them 15,000 shillings (£103) a gig.

Bashaija was one of the dancers – in the contemporary rather than the traditional category, he told me. He, like all the others, was passionate about the project: “It gives us a chance to express ourselves, as Ugandans and as LGBTIs. To be proud of being Ugandans too!” It also created a space where they could connect with local Kenyans, rather than living in fear. The way they could express themselves, he elaborated, was by using the cover of dance to “gay it up a bit”, and, in the traditional dances, to make space for those members who were “girly” to play the female roles, on the pretext that they were an all-male troupe.

I noticed, however, that as the Ugandans arrived at the club, there were several women too. The group’s leader, Zacky, explained to me that the club owners had become anxious and had not invited them for several weeks: in fact, they were performing for free this afternoon, just so they could show me what they did. Zacky worried that the owner – or the patrons – might have become uncomfortable with the “girly” factor and begun to suspect that they were gay: for this reason, they had decided to rope in a group of female Ugandan LGBTI refugees to join them, as cover.

Uganda’s president, Yoweri Museveni, speaks after he signed the Anti-Homosexuality Bill on February 24, 2014 in Entebbe. Photograph: Isaac Kasamani/AFP/Getty Images

Zacky was the compere. “Representing!” he shouted into a microphone from a DJ box, wraparound sunglasses glued to his face. “Rep-REEEE-SEN-TING!!!!” He pumped the beat, a Ugandan jive, and after shouting the gerund a few more times, he finally came to its object: “Rep-re-sen-ting UUUUUUUUUU-gan-da!”. The dancers emerged, in a line, led by James, the muscular lead dancer whose ability to transform the traditional Baganda hipswing into a rapid-fire twerk stole the show. The men were barechested, with cinched traditional skirts hitched high up the thigh; the three women were decidedly more self-conscious.

The programme ran through traditional dances from across Uganda, and threw in some stirring gospel numbers too. The crowd was thin that afternoon, just a handful of punters who giggled occasionally and applauded politely and seemed to be enjoying themselves. No matter. The Ugandans had brought their own home crowd, and each dance was enthusiastically documented by a battery of phones: clips would be all over social media that evening. The troupe was loving it, and I was too. The showstopper was a song from the north, titled Eteso Emali, in which a prospective groom bargains a bride price with his betrothed’s family. The strapping James played the groom, mugging burlesque; Bashaija’s boyfriend, George, was the bride’s father, his lanky frame sheathed in a long white robe. Rabia, the only female resident at the Ark Communes, played the bride, and another woman her mother. Both women were exceptionally – and no doubt accurately – diffident in their roles, and I wondered whether the guys had restrained themselves similarly when they played the female parts, before they felt compelled to bring these shy beards into the show.

In another song, Okuzala Kujjagana, which means “the joy of having a child”, a mother counsels her betrothed daughter about the pleasures of parenthood. There was something terribly poignant about the manifest satisfaction these queer outsiders took in performing such family-making rituals, given the way that most of them had been cast out of their own.

Bashaija had participated in these traditional dances, albeit with his braids held in check by the knitted red beanie. His expression was more earnest, more interior, than most of the others, and he chose to keep his T-shirt on. He re-emerged, during the costume change, in his skinny green jeans, the beanie still in place, to dance the “contemporary music” interludes, either alone or with one other guy. His moves seemed carefully planned at first, and were striking in the way they swirled a macho hip-hop staccato style into something more feminine.

Bashaija would leave the Ark Communes house in October 2015, because it was beginning to seem unsafe. Indeed, two weeks after his departure the remaining Ark residents faced off against a mob and had to call the UNHCR to help evacuate them. The agency put them up in a hotel for four days and then advised them to live in smaller, less conspicuous, groups.

Four months later, on 1 February 2016, Bashaija would finally receive his “mandate” from the UNHCR and the Kenyan government: he would now have formal refugee status, and the right to work and study in Kenya. But he and the other LGBTI Ugandans would also be told that, due to the UNHCR’s limited resources, financial assistance to them would be discontinued by the middle of the year. While there would be some aid available to those with viable business plans, and emergency funding for particularly vulnerable people, most would have to fend for themselves – or move up to the Kakuma refugee camp. By this point, Bashaija would be well into his interviews for resettlement elsewhere.

But all this was to come. Now, on a mild August afternoon, as the speakers pumped hectic bass into the Ngong foothills, Bashaija closed his eyes and allowed himself to be shaped by the beat. His movements became less structured and more fluid. The earnest expression he had worn in the traditional dances released itself into a beatific smile.

No one was watching him but me.

Main photograph: Jessica Rinaldi/Reuters

This is an edited version of a piece that appears in Safe House, a selection of new African narrative journalism published by Cassava Republic Press in partnership with Commonwealth Writers. Some names have been changed

• Follow the Long Read on Twitter at @gdnlongread, or sign up to the long read weekly email here.