While photographer Robin Hammond was on assignment with National Geographic Magazine in Nigeria in 2014, he heard about five young men in Lagos who were arrested and facing the death penalty — just because they were gay.

A few days later, he tracked them down. By that time, the case had been dismissed, but the men had been ostracized by their families, were homeless and in hiding, and faced an uncertain future.

Hammond was deeply moved by their stories. He took their photos and asked them to write their own accounts of what had happened.

"Their personal testimonies connected me in a way that statistics or stories in newspapers couldn't," he says.

Hammond wanted to hear more stories. Over the next few months, he traveled to countries with anti-gay laws like Cameroon, South Africa and Uganda to interview and photograph people who'd been discriminated against for being lesbian, gay, bisexual or transgender.

Clockwise from center: B., Kenya; Boniwe, South Africa; Ratib, Syria; Lizzue, South Africa; Amanda, South Africa.

In May 2015, with $20,000 from the Getty Grant for Good, he started a project called Where Love Is Illegal. Hammond publishes stories and photos from his travels; users can also submit their own. Any survivor of LGBT persecution — no matter what country they come from — is welcome to use the platform to speak out and raise awareness for gay and lesbian human rights.

So far, there are nearly 120 stories on Where Love Is Illegal, and more than 132,000 followers on the Instagram account. Hammond adds a new story almost daily.

Around 3 billion people in nearly 80 countries live where identifying as LGBT could lead to imprisonment, corporal punishment or even death, says Outright International, a group that monitors LGBT human rights violations and provides data to the U.N.

"These people live in countries where they're deliberately silenced," says Hammond, 40, who is from New Zealand and is not gay. "Discrimination thrives in environments where those persecuted do not have the opportunity to speak out or have their stories heard."

During his travels to Africa, Hammond said he saw a lot of homophobic statements from politicians and church leaders in the media — but almost never heard from members of the LGBT community, who were too intimidated to share their point of view.

Clockwise from center: Gad, Syria; Gabriel, Nigeria; Ishmel, Nigeria; Miiro, Uganda; Buje, Nigeria.

Scroll through the Where Love Is Illegal website and you'll see dozens of testimonies, from the U.K. to Uganda. For many people Hammond met, it was the first time they had ever spoken openly about their sexuality.

A man named Ishmel, depicted in a photo with his back to the camera, shares the consequences of being gay in Nigeria. Some people in his neighborhood had heard rumors that he was gay, so they entered his house, beat him and brought him to the police, he says.

"I spent almost one month in prison with not enough food, not taking a bath, not even seeing sunlight," he writes. "After I was released, I faced many problems with my relatives and my friends .... Sometimes I even think that I should leave the world because of the terrible condition that I found myself in."

A 16-year-old named Kofi from Ghana sounded more hopeful.

"Thanks to Chris Colfer from Glee, I knew who and what I was and am," he writes. "One day I will leave Ghana and start over on some far-off land where me being gay will be a cause for celebration, and I will no longer have to hide."

The project is growing. Hammond has a volunteer staff of 10, and some of his own photos from the project have been exhibited in galleries in San Francisco and New York. Global LGBT groups have reached out and asked permission to share some of the stories.

Hammond's next step is to create storytelling workshops in countries where same-sex relations are outlawed, like Kenya. He'll teach a group of 10 people to capture stories for Where Love Is Illegal, and he hopes they'll each train 10 more people to do the same.

And perhaps one day his project will no longer be relevant.

"Look at this country, where we were 50 years ago. People were out on the street campaigning against gay rights. And now they're doing the opposite," Hammond says.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.