NEW YORK – A yellow cab creeps along a desolate Manhattan street, following Aludein Marks and a friend on a cold spring night.

Marks, a teen who identifies as a transgender female, knew what the driver wanted—sex—but she wasn’t doing that work anymore. The cabbie trailed her for several minutes before finally driving off.

“This life, it gets depressing,” said Marks, a soft-spoken 19-year-old who goes by the name Diamond. In the last year, she had experienced periods of homelessness, sleeping at a park, friends’ places and shelters after fighting with her mother over a number of issues, including her romantic interest in men and her gender identity. (Diamond’s mother declined comment).

Despite the gains made for gay rights in recent years, homeless LGBT (lesbian, gay, bisexual and transgender) youth have benefited little. Instead, their numbers on the streets have swelled, representing up to an estimated 40 percent of the nation’s young adult homeless population, data shows. In many cases, LGBT youth choose or are forced to leave home because their families don’t accept them. Once homeless, they are exposed to the perils of street life: violence, survival sex, and, in some cases, HIV.

Gay youth homelessness has been an issue since at least the 1969 Stonewall riots in New York, often regarded as triggering the modern gay rights movement, in which many homeless youth participated.

Reliable research in this area has been limited, but a survey of shelters nationwide from 2011 to 2012 found that up to 40 percent of homeless young adults were LGBT, according to the study conducted by three human rights groups. Overall, the National Alliance to End Homelessness roughly estimates that 550,000 people up to 24 years old are homeless over the course of a year.

Gay youth fleeing their homes flock to a few cities like New York, where more resources are available. But many end up sleeping outside on benches, at parks or in bushes, like at New York’s Christopher Street pier – long known as a refuge for homeless young adults.

“It’s hard for me to imagine a worse and more harmful expression of homophobia in our time than the fact that there are hundreds of thousands of kids who are being rejected by their families and put out onto the streets,” said Carl Siciliano, executive director of the Ali Forney Center, a shelter for LGBT youth in New York.

Only 4,000 beds are available across the country for homeless young adults; of those, 350, mostly in New York, are LGBT specific. Shelters often have to turn kids away, schooling them on sleeping on the subways, Siciliano said. In Detroit, shelter leaders said they tell youth where they can squat with others in abandoned homes.

The homelessness has worsened, activists said, even though acceptance of the signature gay rights issue of the last decade—same-sex marriage—has risen. That shift, plus the emergence of gay celebrities and popular LGBT-themed televisions shows, has encouraged youth to come out earlier. Dr. Caitlin Ryan, director of the Family Acceptance Project at San Francisco State University, said her group has seen more youth first disclosing their sexual orientation between the ages of seven and 13.

“Young people are feeling more and more comfortable in coming out,” said Mark Erwin, director of community development at Detroit’s Ruth Ellis Center, which works with LGBT young adults. But his center now has more young people seeking help. “Although their peers maybe okay with it, we know that their families may not yet be.”

“I was playing with him, but I was saying things that were hurting him, and I wasn't aware of it."

Such was the case for Torreano David Stanley, a 20-year-old from the Bronx who identifies as gender fluid—female most days. She said some of her relatives were not supportive as she tried out dresses and wigs with female hairstyles. She lived at her sister’s house after her mother died years ago.

Her extended family told her “that I need to change my ways or leave,” she said. “I knew that they were talking about me being gay."

Torreano David Stanley is a 20-year-old from the Bronx who identifies as gender fluid—female most days. Michael Rubenstein / for NBC News

Stanley’s sister, Deonna Cleckley, said she wasn’t aware of that but did admit to struggling with Stanley’s gender identity and sexual orientation and making anti-gay remarks.

“I was playing with him, but I was saying things that were hurting him, and I wasn't aware of it,” said Cleckley, who still refers to Stanley as male. (Stanley noted she had not yet asked her family to use female pronouns when referring to her.)

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Stanley said she didn’t feel comfortable at her sister’s house and left in January. “My heart was broken,” she said.

Her sister’s was, too. Cleckley couldn’t find Stanley and feared Stanley could become a victim of violence. “It hurt me a lot,” she said.

Stanley would join the multitude of LGBT homeless youth in New York seeking a shelter bed. She got one after sleeping on the subway for a week, but others can wait weeks or months. In June, Siciliano’s center launched a campaign with the National Coalition for the Homeless, calling for the federal government to add 22,000 youth shelter beds nationwide, corresponding to the number of all youth who were on the streets one night last year when the U.S. Department of Housing and Urban Development (HUD) conducted its annual homeless assessment.

"The concern is that in places where there are no beds, and there are no street outreach programs or services, these are the hidden homeless."

Determining how many LGBT youth are on the streets is difficult: HUD doesn’t ask the homeless about sexual orientation (but for the first time this year it inquired about being transgender). While the U.S. Department of Health and Human Services (HHS) has a reporting system for shelters that includes questions on LGBT status, researchers said not all agencies may be aware of the sexual orientation or gender identity of the youth they’re serving. Young people may also not offer that information.

“The concern is that in places where there are no beds, and there are no street outreach programs or services, these are the hidden homeless,” said Jerry Jones, executive director of the National Coalition for the Homeless.

For displaced youth, daily challenges include the search for food and a bed, and finding trusted friends on often hostile streets. Many spend their days at youth centers, where they can use computers, get health checks, a meal and attend life skills classes. But in the evening, they’re back outside.

Some LGBT teens and adults interviewed by NBC said they were raped on the streets. Others were victims of theft, like Lucina Rodriguez, a 21-year-old transgender female who sought refuge for several months on the subway last winter. Once when she nodded off on the train, someone took her backpack containing her laptop and birth certificate, she said.

“I just wanted to break something at that point. I could not take it anymore,” she said.

Rodriguez, who lines up paid internships as she builds her resume in hopes of getting a permanent job, got a shelter bed in the late spring. But even being there isn’t without trouble, she said, since desperate youth sometimes steal from one another.

She may soon be back on the subway again since her shelter spot is only good through early August. “I have grown accustomed to being on the streets, and that’s bad,” she said.

Rodriguez said she left home at age 19 after getting angry with her mom. She figured out she was transgender two years earlier but didn’t explore her gender identity until she was on her own. That “was when I started to come to terms with myself and to express who I felt I was on the inside,” she said.

She feels her mom accepts her being transgender, but the pair has other ongoing disagreements, so she won’t move back home (her mother couldn’t be reached for comment).

“Housing is HIV prevention. ... If you have certain basic needs that aren’t met, like food and shelter, then HIV is not the most pressing concern on people’s minds. They need a warm bed."

Family acceptance is critical to the well-being of LGBT young adults, said Ryan, of the Family Acceptance Project. According to a 2009 study by the project, youth who are highly rejected by their families are more than eight times likely to have attempted suicide and nearly six times as likely to report high levels of depression. They are also more than three times as likely to use illegal drugs and to be at high risk for HIV and sexually transmitted diseases.

HIV risk is a much-discussed fear among homeless LGBT youth. New infections among gay male 13-to-24 year olds increased 22 percent from 2008 to 2010, according to the Centers for Disease Control and Prevention’s most recent data. Young, black gay men are severely affected, the CDC said, accounting for more new infections than any other subgroup.

The link between HIV and homelessness among LGBT young adults is clear, activists and researchers said.

“Housing is HIV prevention,” said Jeremy Ortman, assistant director of mental health at Gay Men’s Health Crisis. “If you have certain basic needs that aren’t met, like food and shelter, then HIV is not the most pressing concern on people’s minds. They need a warm bed.”

Three weeks after brushing off the cab driver, Diamond said she received devastating news: Tests revealed she was HIV positive. She believes she contracted the virus from a man whom she felt could be a romantic partner. “I thought we were going to be more,” she said. “I guess I was vulnerable.”

After being on the streets, Diamond’s HIV diagnosis meant she qualified for a city housing stipend. She is staying in a motel-like room at a transitional housing facility in the Bronx while she looks for a permanent place.

Diamond wants to have a relationship with her mom but said her mom doesn’t accept her and won’t let her come home. “Sometimes I have hard days,” she said. “I think about stuff a lot. I try not to.”

Ryan’s group, the Family Acceptance Project, has found that many families who had kicked their children out “later regretted it but it was too late,” she said. “Some of them had no contact with their children.”

The group started an initiative in March to teach families, religious leaders and social service workers ways to help stem gay youth homelessness and suicide in Utah.

“It’s so important to help families understand that they can support that LGBT adolescent even if they think that being gay or transgender is wrong,” she said.

“You love this boy, you do things that are right for him because the only person you would be hurting will be yourself and him.”

In Detroit, the Ruth Ellis Center said it will soon sign a state contract to work with child services in a bid to prevent gay youth from leaving home. Believed to be the first program of its kind nationwide, it will involve individual and family counseling over 13 months, and will begin in 2015.

“We can continue to talk about the lack of shelter beds, but until we actually address the root cause of youth homelessness, especially LGBT youth, this is going to be an endless cycle,” Erwin said. “We need to meet young people and families where they’re at.”

Cleckley said such programs could have helped her better understand what Stanley was going through. The pair has slowly reconnected over the last few months through phone calls and visits, and Cleckley said she is determined not to be estranged from Stanley again.

In a recent conversation between the siblings, Cleckley said she had a message for other families struggling to accept LGBT youth: “Don't care about what nobody else is saying on the street,” she said. “You love this boy, you do things that are right for him because the only person you would be hurting will be yourself and him.”

Moved by her sister’s message of acceptance, Stanley said, “It means a lot to me.”