Nigeria’s passage of a law criminalizing same-sex relationships drew immediate international outrage earlier this year. In New York, gay activists held protests outside the Nigerian government’s offices, something that amazed Rahima Gambo. With so much of life hidden in Nigeria, she said, nothing so bold would have happened there.

That realization led Ms. Gambo, a Nigerian photographer raised in London, to explore the lives of the growing number of gay men who have fled to the United States seeking asylum and a chance to live freely. It was during the March protest in New York that she met Saheed Ipadeola, a young man living in Brooklyn who introduced her to other asylum seekers. They shared their stories in ways that would never be seen in Nigerian media, which she said reduced them to stereotypes without dignity.

She saw them as survivors.

“Many of the men I document are proud of their identities and still connected to family members in Nigeria, but there’s this constant strain of wanting to be vocal but fearing for family and loved ones,” Ms. Gambo, 28, said. “All of the men always say there was nothing to go back to. They all talk of this fatigue of the Nigerian system, and the law being passed was a final nail in the coffin.”

Ms. Gambo started her project earlier this year while in graduate school and later pursued it as a Magnum Foundation fellow. The enactment of Nigeria’s Same Sex Marriage Prohibition Act in January effectively banned homosexuality, making it illegal for gay people even to hold meetings. The law reinforces hatred of the gay community, the asylum seekers said, going far beyond mere opposition to same-sex marriage. Two men can be jailed for holding hands or other public displays of affection. Homosexual clubs, associations and organizations were outlawed, with penalties of up to 14 years in prison.

Photo

While same-sex unions have not been a widespread cause among gay Nigerians, activists asserted that the new law was an alarmed reaction to the support of same-sex marriage in the United States, reflecting fears that it could become a local issue and rallying point. Activists told Ms. Gambo it had already prompted people to flee out of concern for their health and safety.

Desiring a better life, to live freely without shame or fear, some of them wind up at programs like the Asylum Project, run by Housing Works in Brooklyn, which provides gender-rights activists from sub-Saharan Africa, Nigeria and Uganda with assistance obtaining legal asylum, housing, jobs and medical care.

Many of her subjects requested anonymity. Many, too, shared heartbreaking experiences.

“I was told stories of a young H.I.V.-positive man who was banished from his family home and sent to live with his 90-something-year-old grandmother in rural Nigeria, and with a lack of health care, he died,” Ms. Gambo said. “A lesbian woman was held captive in a church for six months and forced to endure corrective rape. L.G.B.T. people in rural areas and many urban areas in Nigeria don’t know that there are services for them, and now the law affecting them makes things even more difficult.”

There are economic and health impacts too, Ms. Gambo learned. One resident of the asylum house had worked as a community organizer in the gay community who advocated sexual health services, including giving away condoms to prevent the spread of H.I.V. The new law, he felt, made him a criminal for supporting gay rights.

“What do you do if the law criminalizes your job?” he said. “I’m married with two kids, what do I do now? I feed my family from the work I do; I have to run for my safety and the future of my family. I lived with the fear of jungle justice, people pointing me out in the street.”

The moral stigma associated with homosexuality, he and others feared, drives people into the closet. That, in turn, increases the community’s heath risks if people can’t access critical health and medical services.

Photo

These vulnerabilities of gay men are not unique to Nigeria. An undercover culture of men on the “down low” exists in the African-American community too, particularly in the South, where religious beliefs and family pressures force some to lead secret lives. Being black and gay in America is double trauma for the asylum seekers, because racism is something they now have to face in the United States.

Still, it is better than what they have endured in their homelands. And they see Ms. Gambo’s work as important to drawing attention to their plight here and back home.

“The work Rahima is doing is critical considering the antigay law that was passed and considering many other African countries working to criminalize or have already criminalized people for basically who they choose to love,” said Adejoke Tugbiyele, who met Ms. Gambo at a pride parade. She is both a subject in her series as well as an artist who made “AfroOdyessy,” a film that examines the complex issues surrounding homosexuality in Nigeria.

Ms. Gambo’s images reflect the loneliness and isolation experienced by gay asylum seekers from Africa. Issues of trauma, depression and suicide often plague them. As a result of being disowned by their families, many had already risked homelessness. Her photos show them trying to change their lives — if not their homeland — in their new community.

“I wanted to explore what that feeling of displacement felt like and the broken and new bonds that formed when you were rebuilding your life and your identity in a new country,” she said, “suddenly free to explore your identity without fear of shame, harassment or violence.”

Fayemi Shakur is a writer based in Newark. Her work has been featured in Nueva Luz Photographic Journal, Hycide Magazine and The International Review of African American Art.

Follow @RahimaGambo, @7fayemi, and @nytimesphoto on Twitter. Lens is also on Facebook.