The LGBTQ revolution began on a steamy night in June 1969, when a group of women and gay men — many of them drag queens — rioted in response to a police raid on the Stonewall Inn in New York City’s Greenwich Village. For years, such raids had been standard operating procedure for police in New York and other US cities. But the night of June 28, 1969, marked the first time that large numbers of LGBTQ people fought back against police harassment and abuse.

Before Stonewall, lesbians and gay men were perceived as disconnected people whom religious institutions denounced as sinners and the American Psychiatric Association’s manual listed as suffering from a mental disorder. Sexual relations between members of the same sex were illegal in all 50 states. With a few exceptions, gay people who attempted to come out of the closet risked the loss of their jobs and ostracism from their families. The terms “lesbian,’’ “gay,’’ “bisexual,’’ and “transgender’’ were barely on the cultural radar. The acronym LGBTQ was still decades away.

A year after Stonewall, New York City held its first Gay Pride parade. Los Angeles, Chicago, and Boston held similar marches. In the previous decades of fear, shame, and hiding, pride in being gay had been an almost inconceivable concept and hardly the basis for a personal identity or a social and political movement. But there it was, for all to see.

By the early ’70s, a rich community life was evolving across the country. There were gay and lesbian bookstores and publishing houses, volleyball and softball teams, cafes and restaurants, choruses and marching bands, churches and synagogues. Soon, almost every major city in the United States had its own gay newspaper, ranging from San Francisco’s Bay Area Reporter to Boston’s Gay Community News. The exodus of LGBTQ people from small towns to more friendly urban centers increased dramatically. By the middle of the decade, some 40 US cities had enacted gay rights ordinances. In 1974, Elaine Noble was elected to a seat in the Massachusetts House of Representatives, becoming the nation’s first openly gay legislator.

In the atmosphere of the closing years of the decade, with its rising opposition to issues like abortion and the Equal Rights Amendment, a counterrevolution emerged. Anita Bryant, former Miss America runner-up and pitchwoman for Florida orange juice, was the backlash’s unlikely public face, founding an organization called Save Our Children. Under Bryant’s leadership, in June 1977, voters in Florida’s Dade County, which includes Miami, overwhelmingly repealed its gay rights ordinance in a referendum. Other localities followed suit. A tragic postscript to backlash was the assassination of openly gay San Francisco City Supervisor Harvey Milk a year and a half later.

Gains, losses, suffering, and yet more gains became the paradigm of what was to come for the next 40 years. By the early 1980s, AIDS was decimating the gay male community, and many wondered if the LGBTQ movement would survive. The toll was horrifying: The CDC estimates that 330,000 gay and bisexual men have died of AIDS in the US since the 1980s. However, what followed was an outburst of activism and, later, anger at governmental apathy. A sober, mature LGBTQ community, caring for itself and for others, emerged in the national spotlight, and lesbians took a visible role in supporting gay men, engendering a greater solidarity than in the past.

The US armed forces ban on LGBTQ people was a flashpoint for many years. In the 1992 election, Bill Clinton became the first presidential candidate to actively court the gay vote, yet when he attempted to fulfill a campaign promise to end military discrimination, he was forced into ignominious retreat. Under Barack Obama, the ban on LGBTQ military service was finally repealed, but once Donald Trump was elected, he partially restored the ban by executive order, this time singling out transgender people. As always, it was two steps forward and one step back.

The most important step forward came in the 2015 US Supreme Court decision legalizing same-sex marriage nationwide. Marriage equality gave LGBTQ people and relationships a legal status and a social standing. The LGBTQ family became a part of the American suburban landscape, with lesbian couples and some gay men raising children. Movie and TV characters and story lines gave additional credence to the “mainstreaming’’ of LGBTQ life. Joe Biden, in announcing his support of gay marriage, said that the TV sitcom “Will and Grace’’ “probably did more to educate the American public than almost anything anyone’s done so far.’’

LGBTQ life was clearly changing. The arrival of the Internet lessened the isolation of rural and small-town LGBTQ people, an often overlooked development, and also sounded the death knell for gay bars, long the central meeting place for LGBTQ people.

Much of this progress remains uneven today, often along “blue’’ and “red’’ lines. In 27 states, LGBTQ people can still be fired for being gay. While most mainline Protestant denominations and Reform and Conservative synagogues have moved toward acceptance of gay people, and Pope Francis famously replied “Who am I to judge?’’ when asked about gay priests, conservative religious institutions have remained mostly unbending. Young LGBTQ people continue to struggle with homophobia and lack of support in many school districts; lesbian, gay, and bisexual youth are almost five times more likely to attempt suicide than their heterosexual counterparts, according to a 2016 CDC study. While many colleges and universities provide a haven, a recent NPR story shared the experiences of students who had come out as gay in college, only to return home during the COVID-19 lockdown to face ostracism by their families. Violence against transgender people remains at shocking levels, with 26 transgender or gender-non-conforming people — mostly Black women — murdered last year, according to the Human Rights Campaign.

Less than two hours after Trump’s inauguration, the White House webpage removed all mentions of LGBTQ issues. The administration has used the issue of “religious freedom’’ to undermine rights protections, permitting federally funded adoption agencies to reject same-sex couples, for example. Trump’s appointment of conservative judges to the federal courts will be tested when the US Supreme Court rules later this session on whether Title VII of the 1964 civil rights law bars LGBTQ employment discrimination.

Despite the adversarial stance of the White House, the momentum continues. Former South Bend mayor Pete Buttigieg’s strong showing in the race for the 2020 Democratic presidential nomination surprised many. In 2018, two openly LGBTQ candidates were elected governors. There are currently two serving LGBTQ senators — Tammy Baldwin of Wisconsin and Kyrsten Sinema of Arizona — and seven serving US representatives, including Sharice Davids of Kansas, the first LGBTQ Native American member of Congress. Although formidable obstacles remain, LGBTQ Americans encounter a remarkably changed landscape, with a broader range of possibilities for their lives than could have been imagined by those first courageous Pride marchers 50 years ago.

Neil Miller is the author of “Out of the Past: Gay and Lesbian History from 1869 to the Present.’’ He teaches journalism at Tufts University.