Fifty years ago this June, a routine part of life for gay men, lesbians, bisexuals, and transgender people suddenly became intolerable. Rather than scatter or submit to a police raid on the Stonewall Inn, a gay bar in New York City’s West Village, LGBTQ people fought back, resisting arrest and attacking police officers.

The Stonewall riots took place in the context of a nation in upheaval, with other movements, including the anti-war and Black Power movements, increasingly embracing a spirit of militancy and radicalism. Stonewall was not, as it’s often imagined, the very first moment that LGBTQ people asserted their right to exist; organizations seeking rights for gays and lesbians had been around since at least the 1950s, and there were other, smaller riots in response to police raids on gay bars in New York City and elsewhere in previous months. But that rioting and rebellion across six nights inspired a new audacity in the fight for gay rights.

The movement kindled by the Stonewall uprising urged queer people, “Come out! Come out!” The great personal courage exhibited by LGBTQ people—some activists, many not—fueled a profound shift in culture. Along with feminism, gay liberation is to thank for broadening notions of what women and men can be, for decoupling gender and sex, for developing visions of partnership freed from the straitjacket of predetermined gender roles and of family unbound by biological and legal ties. The movement put forward more expansive ideas about desire and pleasure and, in so doing, made it more possible for everyone, queer or not, to seek love and joy in ways more true to themselves.

With that cultural revolution came an explosion in LGBTQ people’s political power, laying the groundwork for a rapid advance of civil rights and legal protections. Surveying the years since, one could be forgiven for feeling a sense of vertigo. Laws making homosexual sex illegal were considered constitutional until 2003; 12 years later, the Supreme Court granted same-sex couples the right to marry in every state. In the decades after Stonewall, dozens of victories were won, each building on the ones before. In some places, gay and trans people began to be protected at their jobs and in public accommodations; discrimination based on HIV status was made illegal; gay people won the right to adopt children and were permitted to serve openly in the military; years of asking courts to recognize same-sex marriages resulted in civil unions, then in marriage equality.

The pace of change is dizzying but uneven. Anti-LGBTQ violence has increased in recent years; transgender women of color, 10 of whom have been killed so far this year in the United States, are at particular risk, in part because they face epidemic levels of economic and housing insecurity. Among homeless youths, 40 percent identify as LGBTQ. States are expanding protections that allow health-care providers and others to discriminate against LGBTQ people on religious grounds. Next term, the Supreme Court will rule on three cases that raise the basic question of whether LGBTQ people are protected from discrimination under the Civil Rights Act—and with Trump appointees Brett Kavanaugh and Neil Gorsuch on the court, it’s likely the justices will decree that they are not. In 11 states, a federal-circuit-court interpretation that the Civil Rights Act bars discrimination based on sexual orientation and gender identity is the only legal protection LGBTQ people have; in 15 other states, there is no such protection at all. The fact that it is still legal in parts of the United States to fire gay and trans people simply for being who they are takes an enormous toll, economic as well as psychological.

Stonewall shows us what fighting back looked like in an era when state power was hostile and the wider world unmoved at best and bigoted at worst. Contemplating such fundamental threats again today, LGBTQ people can return to Stonewall’s lessons of rebellion and resistance. Solidarity matters. Explosive confrontations can be the crucible of a long, hard struggle. Defiance, exuberance, and bravery can change the course of history.