A Toronto-based charity is providing an escape for people who live in countries where they are persecuted for their sexual orientation.

"What that means is it's illegal to be who you are," Rainbow Railroad Executive Director Justin Taylor told CTV's Canada AM on Thursday.

"If you are fired from your job, if you are violently attacked on the streets, if anything dangerous happens to you, you have no recourse to the police. If you go to the police, you'll be thrown in jail."

The Rainbow Railroad helps members of the lesbian, gay, bi-sexual and transgender (LGBT) community get to safer countries.

The organization was founded in 2006, following the World Pride event in Israel. Canadians who attended the event met a young Palestinian man who said he had been tied up in his basement and stabbed by his parents, Taylor said.

He was able to escape to Israel, where he was living illegally. The man's story moved the Canadians to come up with a solution for others in similar situations.

The charity's founders were inspired by the "Underground Railroad," a network of secret routes and safe houses used in the 1800s by African Americans to escape slavery in the southern United States.

Like the Underground Railroad, the Rainbow Railroad consists of a series of volunteers, social workers, lawyers and organizations who can help refugees claim asylum.

There are at least 76 countries that retain laws used to criminalize and harass people based on their sexual orientation or gender identity, according to the United Nations.

"For a lot of women, there's a practice called 'corrective rape,' where if they're lesbians, a group of men will rape them to try to 'correct' the situation," Taylor said.

"For a lot of the men, they've been violently attacked in their homes, ostracized from their families and they have no resources."

In some countries, including Iran, Mauritania, Saudi Arabia, Somalia, and Yemen, the death penalty can be applied in cases of consensual homosexual relationships.

The Rainbow Railroad helps those living in fear to escape to Canada, the U.S. and Western Europe. The cost to help one person is often approximately $5,000.

The organization receives requests through Facebook and email, and its services are in such high demand that it can only afford to assist the most serious cases. The Railroad focuses on helping those who are experiencing physical violence or are under an imminent threat of violence, imprisonment, or death.

So far this year, the organization has had requests from 95 people. Since January 2015, it's been able to help 14 people find safety.