PHILADELPHIA — DENISE SAMEN, who is 65 and a military veteran, has not had an easy life. She lost an arm in a train accident, supported herself by working a series of low-paying service and clerical jobs, needs a wheelchair to get around and came of age when homosexuality was considered a psychiatric disorder. And though she has never hidden who she is — she often dresses in men’s-styled clothing — she doesn’t play it up, either.

“I was guarded,” she said.

At the Brooklyn apartment complex where she used to live, she edited the community newsletter, and one June day, she decided to include a banner headline reminding residents it was gay pride month.

“There was this one woman who didn’t take that kindly,” Ms. Samen said.

The neighbor taped an anonymous and disparaging note on her door (Ms. Samen sleuthed out the perpetrator’s identity). And though Ms. Samen fired back with a July 4 editorial about respecting your fellow Americans, it left a bad taste.

So it was with great pleasure that she recently moved into the John C. Anderson Apartments here, a new, rent-subsidized 56-unit building for older adults where about 90 percent of the tenants are gay. “You don’t have to explain yourself,” she said. “You don’t worry about anyone putting you down.”

Among her new neighbors is Susan Silverman, 65, a retired social worker whose lesbian activism dates to the 1969 Stonewall riots, when street protests after a police raid on a bar in Greenwich Village helped kindle the gay rights movement; Elizabeth Coffey Williams, also 65, a transgender woman who appeared in a number of John Waters films; and Jerry Zeft, 70, a former Internal Revenue Service administrator who was in the closet for years.

Mark Segal, the developer of the apartment complex, tells visitors how liberating living here is: “We have a man in his 90s getting around with a walker, and for the first time in his life he’s wearing mascara. We have a regular mah-jongg game where lesbian separatists play with the men.”

The Philadelphia building, which has a waiting list of 85, is the nation’s third government-subsidized low- to moderate-income housing project for older adults that is specifically intended to be welcoming to gays. Triangle Square in Los Angeles, built in 2007, and Spirit on Lake, which opened in Minneapolis in 2013, were the first two. Three more are expected to open in the coming year in Chicago and San Francisco and a second one in Los Angeles.

There is a real need for this housing, said Michael Adams, executive director of Services and Advocacy for Gay, Lesbian, Bisexual and Transgender Elders (SAGE). In a recent study, the Equal Rights Center in Washington had testers in 10 states pose as either gay or straight couples and make phone calls to senior living facilities.

In nearly half the cases, according to the study, the same-sex couples faced discrimination from housing agents, such as not being told about vacant units that were mentioned to the straight couples.

Mr. Adams said that in the last decade, about two dozen market-rate retirement communities aimed at gays had been planned but were not built, in part because of the collapse of the real estate market.

The Rainbow Vision community in Santa Fe, N.M., opened in 2006 but declared bankruptcy in 2011 and is now being reorganized as a complex aimed at a general population of older adults.

For older people in need of extra assistance, the only continuing care community aimed at gays, the upscale Fountain Grove Lodge in Santa Rosa, Calif., which opened last fall, offers independent- and assisted-living apartments, as well as 33 units for residents with dementia. Rental and service fees run from $3,395 to $5,125 a month.

At the John C. Anderson Apartments, 10 percent of the residents have an income below $11,100, and the maximum allowable for a two-person household is $38,040. They pay rent on a sliding scale, from $192 to $786 monthly.

Mr. Segal used $2 million in grants from the city, $6 million from the state and $11.5 million in low-income housing tax credits to help pay for the $19 million building. And because, he said, he has learned to be persistent, annoying and friendly all at the same time when dealing with politicians — “They’ll say ‘yes’ to me so I’ll go away” — the project was finished within two years of buying the land. It is in Center City, one of Philadelphia’s most popular neighborhoods.

Mr. Segal’s name is widely recognized among gay activists like Ms. Silverman, who knew him in the 1960s when he helped found the Gay Liberation Front and Gay Youth. In 1973, he made headlines when he ran in front of the cameras during the “CBS Evening News” with Walter Cronkite carrying a sign that read, “Gays Protest CBS Prejudice.” Both President Bill Clinton and President Obama have invited him to the White House for events feting gay Americans.

He is the heart and soul of the apartments, and though he has been giving visitors his standard tour for weeks now, he continues to find his own jokes funny. “Follow me,” he said, rushing out a door onto the sun deck. “There’s a big debate about whether to make it clothing optional — and that’s the naked truth. Naked truth!”

Limiting the apartments to gay, transgender or bisexual residents would be discriminatory and illegal, but Mr. Segal has been able to create a largely gay residence by holding information sessions at community centers in gay neighborhoods and advertising in the gay press.

The first morning that applications were accepted, Michael Palumbaro, 70, a retired nurse, arrived early to be at the front of the line of people hoping to be selected; he was No. 43. For years
he lived alone in a blue-collar neighborhood of Northeast Philadelphia, which, he says, wasn’t particularly gay-friendly.

“I had a partner who worked for the airlines, but he lives in Germany now,” he said. “I’d move there, but he hasn’t asked me to live with him.”

Mr. Palumbaro considers himself a not-so-minor miracle, having lived with AIDS since the late 1980s. He likes that people here share a history, and that he can talk about his T-cell count without explaining. “I’ve made a nice little group of friends,” he said. “We check on each other.” They’re thinking of starting a weekly movie night, maybe chip in and get a pizza.

Surviving AIDS hasn’t been the only miracle. “I grew up when your parents could force you to have shock therapy for being gay. Now we have marriage. And this,” he said, meaning his new apartment.