DAKAR, Senegal—Watching as dusk falls on the dusty streets of this city, Marie, a 27-year-old trans woman, explains that she only leaves her house after sunset. “I don’t go out during the day,” she says, flicking back her long red hair. “Only at night. I don’t even want to open my door.” It can be lonely, Marie admits, but after facing abuse throughout her life, living alone in the dark is the only way she feels safe.

Asking that her last name be omitted for safety reasons, Marie explains that the abuse began when she was just 8-years-old. “I used to wake up early to put on my sister’s clothes before school,” she says. “I didn’t want to disguise myself as a boy anymore.” But in a country like Senegal, where gender roles are strictly enforced, revealing her identity left her vulnerable to attack: After years of bullying, Marie was forced to leave school at 13.

In an effort to correct what her family viewed as an aberration, Marie’s father put her in a strict Quranic school, where things got even worse. “That was the first time I was raped,” says Marie. “The teachers used to come into the dorms at night and take me back to their room. ‘Since you think you’re a woman,’ they’d say, ‘We’re going to show you what we do with women.’” Afterward, Marie would lie awake in the dark, filled with shame, hoping only to be left alone.

Fifteen years later and darkness is still Marie’s only refuge from a society that remains deeply averse to LGBT rights. As is the case in 33 countries across Africa, gay sex is illegal in Senegal, and attacks and arrests of queer people are common (PDF).

“LGBT people operate in a very hostile environment,” says François Patuel, a researcher with Amnesty International in Dakar. “There’s a lot of physical violence against men, and sexual violence towards women. They don’t have any access to justice.”

According to Human Rights Watch, violence against gay men and trans women has increased since 2008. Following a public scandal around a supposed “gay wedding,” gay men “increasingly became targets of popular vengeance and arbitrary arrests.” When one of the men photographed in the wedding, Madieye Diallo, died of AIDS in 2009, an angry mob disinterred his body and dragged it through town, dumping it in front of his parents’ home.

“We had to bury him in the bush,” says Djamil Bangoura, a local LGBT activist and close friend of Diallo. “That’s when I saw the weakness of the state. We are not protected by the law, nor the justice system, nor the police. How do people imagine we can continue to live like this?”

Sadou Ndiaye, 32, a gay man living in Dakar, remembers the period after 2008 with unease: “It was too hard for gay people,” he says. “You couldn’t even leave the house.” Fearing for his safety, Ndiaye decided to flee Senegal for neighboring Mauritania: There, the penalty for being gay is death by stoning. But Ndiaye says that the anonymity of life in Mauritania was better than the constant fear in Senegal, where gay people are often publicly targeted by the media. In Mauritania “nobody knows you, you don’t have to be scared,” he told me. “You can live your gay dream.”

Ndiaye is not alone. According to activist Bangoura, who visited Mauritania recently, there are dozens of gay men there who have fled oppression in Senegal. Still, Mauritania remains a hostile place for LGBT people: “When the police stop you, you don’t have the right to even explain yourself,” says Ndiaye. But unlike in Senegal, Ndiaye explains that rampant corruption in Mauritania means you can mostly just bribe your way out of trouble. “If you pay, they’ll let you go free,” he says. “Money is the only thing that matters over there.”

Still, after a year of frequent arrests, Ndiaye had enough. He decided to return to Senegal in 2010. “Things were a lot quieter compared to 2008,” he says. But the calm didn’t last.

In 2013, U.S. President Barack Obama visited Senegal and raised the issue of LGBT rights with president Macky Sall, who refused to budge. Not long after that, a lesbian woman we’ll call Adja*, who runs a women’s rights group in Dakar, says she was thrown in jail as part of a country-wide crackdown. The following February, police arrested four men who were trying to “clean their neighborhood” by hunting down and attacking gay men.

“Obama came to Senegal and demanded the law be changed,” says Adja. “I would’ve told him, great, but what means do I have to change it?”

Such anti-gay backlashes have become common across sub-Saharan Africa. As Western countries have made increasing progress on gay rights, and in some cases actively pushed for similar advances in Africa, countries like Tanzania, Uganda, and Nigeria have moved in the opposite direction, cracking down on gay rights activism and passing ever more draconian legislation to suppress LGBT people.

Bamar Guèye is the executive director of Jamra, a conservative religious organization in Senegal that often speaks out against homosexuality, despite working on issues like HIV/AIDS prevention. From his dimly lit Dakar office, Guèye suggested why efforts by Obama and others to influence Senegal on LGBT rights have backfired.

“Global society is being turned upside down,” he says. “Just because it happens in their countries they want to impose it on other places. But no one has the monopoly to dictate to others. It’s the winds of excessive liberty.”

In 2015, the backlash continued. Ndiaye, the gay man from Dakar, was one of 11 men arrested at a party for allegedly committing “homosexual acts.” He spent six months in jail. Eventually, Ndiaye was released on appeal, but the experienced has left him shaken, and he’s considering going back to Mauritania.

According to Patuel, from Amnesty International, those 2015 arrests “created panic in the community; people don’t think they can stay here.”

But despite the relative liberty afforded by corruption, life in Mauritania remains dangerous, particularly if you’re one of the 22 percent of Senegalese gay and bisexual men living with HIV. Mauritania’s limited health care system as well as heavy stigma around the disease can make accessing medication nearly impossible.

“Their health is getting worse every day,” says Bangoura of friends and colleagues he visited across the border. “They’re dying in the desert.”

In Senegal, at least, there have been government efforts to tackle HIV among men who have sex with men (MSM), with support from international aid groups. However, such initiatives can only go so far while the government keeps arresting people for being gay. According to a 2011 study of HIV health care in Senegal, there was “pervasive fear and hiding among MSM as a result of the December 2008 arrests and publicity. Service providers suspended HIV prevention work with MSM out of fear for their own safety.”

For trans women, accessing health care is even more fraught. After running away from the Quranic school, Marie, the trans woman in Dakar, escaped to Saint-Louis, a city in northern Senegal. There, a cousin took her in, but forced her into sex work soon after: “I never had a choice,” says Marie, who understood the risks, but felt helpless. “You don’t know these people, you don’t know if they’ll infect you.”

Sure enough, not long after leaving Saint-Louis, Marie found out she was HIV positive. “I wasn’t surprised,” she says sadly. But since getting her diagnosis, Marie says she’s often faced discrimination when seeking treatment because of her appearance. “Every time I go get medicines, even if I’m the first person to arrive, they always make me wait till last. But if I don’t get my medicine, I could die.”

Since returning from Mauritania, Ndiaye has been helping people like Marie to access HIV treatment, organizing free testing events for the LGBT community. He also has a boyfriend now: “I love him,” he says. “He is too sweet.” Still, Ndiaye wants to convince his partner to go back with him to Mauritania. Dangerous as it might be across the border, love in Senegal is lived in darkness. “We can only see each other in the evenings,” says Ndiaye. “It’s always night.”

But Adja and other activists see no choice but to stay in Senegal and keep hoping for a brighter future. “I won’t leave,” she says, as dusk falls on Dakar once more. “If we all leave the country, who will continue the fight?”

*Adja’s name has been changed at her request to protect her identity. The other people interviewed here agreed, despite the risks, to be quoted by name.

Reporting for this story was supported by the International Reporting Project.