A tense standoff in Greenwich Village in June 1969, after rioting followed a police raid on a gay bar.

The best inaugural addresses of presidents past can be reduced to a single phrase or line: "With malice toward none, with charity for all …" (Lincoln); "The only thing we have to fear is fear itself" (Roosevelt); "Ask not what your country can do for you …" (Kennedy).

Barack Obama's second inaugural may not be as enduring as those classics. But it will enter the history books for one line, perhaps even just one word: "Stonewall".

The low-ceilinged dive of a gay bar on Christopher Street in New York's Greenwich Village, which was raided by the NYPD in 1969, is now elevated to American immortality by the head of state. When I heard Obama say Stonewall, I twitched in disbelief. And then, as the president opened his second term with a call for gay equality, I realized just how profoundly, and with what amazing speed, the United States is changing.

For many gay Americans, the excitement of Obama's election in 2008 was tempered by the passage, that same election night, of California's Proposition 8 – the ballot initiative that amended the state's constitution to rescind the right of gay men and lesbians to marry. And Obama himself, both a constitutional law scholar and a committed Christian, had wavered on gay marriage throughout the campaign – and continued to do so well into his first term.

He tried to keep his own beliefs hidden, so much so that the major accomplishments of his first term, from repealing Don't Ask, Don't Tell to recording an "It Gets Better" video, didn't win the favor they deserved. Yet, in the last two years or so, the terrain shifted.

Support for gay marriage and other components of gay equality now has majority support in the country and overwhelming support among the young. Obama's double game could no longer endure – and in a hastily organized interview with ABC's Robin Roberts, he announced that "for me personally", he believed gays ought to have the right to wed.

That was a memorable interview, and one with real resonance for gays. But it's one thing for a politician in an armchair to support equality "for me personally", and quite another for the head of state to bellow out to the National Mall that gays must be treated equally under the law. On the steps of the Capitol, our president declared:

"We, the people, declare today that the most evident of truths – that all of us are created equal – is the star that guides us still; just as it guided our forebears through Seneca Falls, and Selma, and Stonewall."

This was not "for me personally". This was the voice of the body politic, the president speaking in the name of We the People, asserting that, like women and racial minorities, the gays who faced down discrimination and violence are models of American virtue.

"Our forebears," he said, are not just the suffragettes in upstate New York and the marchers in Alabama, but the young kids, hustlers, drag queens and other marginalized members of what's now called "the gay community". The people who beat back that police raid in 1969 and chanted "Gay Power!" in the streets of Manhattan are American heroes, the president proclaimed, and their struggle is an exemplar for our times.

It's worth noting, too, his cunning use of alliteration – Seneca Falls, Selma, Stonewall – the choice of other S-initial locations brought women, blacks, and gays into linguistic as well as political harmony. The president went on: the task for today's Americans, Obama said, is to continue the struggle waged by earlier pioneers of equality. That means fighting for equal pay for women, ending unconscionably long waits to vote, reforming the immigration system, and keeping "the quiet lanes of Newtown" safe from gun violence. And it means something else:

"Our journey is not complete until our gay brothers and sisters are treated like anyone else under the law – for if we are truly created equal, then surely the love we commit to one another must be equal as well."

A loud cheer went up on the Mall after this line, and I hope that the US supreme court justices sitting to Obama's left heard it. For, while it's inspiring to hear the president refer to gays as "brothers and sisters", what makes that line stick is its union of love and equality, making our emotional lives and our civic ones into a common enterprise.

Marriage in America is a civil undertaking, and when the high court rules on two gay marriage cases this June, it's entirely possible that they may strike down discriminatory laws on narrow grounds of privacy or states' rights. Obama, in his address, called for more. He did not say that the government should not to tell gays how to live. He said something much finer: that gay love itself is as valid at its straight counterpart, and the law must reflect that fact.

It is amazing enough that gays are even mentioned in an inaugural address. A statement like that – putting gay love at the heart of gay equality – would have been unthinkable, even a year ago. But Barack Obama is the president of a transformed America, and it's worth remembering, today, that he has been instrumental in that transformation.

Gay liberation has always sat uneasily among other struggles for justice. Civil rights leaders have occasionally bridled at the equation of gay rights to civil rights. In part, that was for the wholly correct reason that for all the discrimination that gays and lesbians face, it pales compared to the horrors of slavery and the endurance of American racism. But on Martin Luther King Day, our first African-American president used his grandest platform to write gays into this country's long struggle for equality.

Placing Stonewall alongside Selma was no mere rhetorical flourish. Nor was it just a shoutout to a loyal constituency. It was the boldest statement yet by a leader whose slow start on gay equality is maturing into full-throated leadership. And it marked the indelible inscription – by our president himself – of gay Americans into the nation's history.

Sign up for the Guardian Today

Our editors' picks for the day's top news and commentary delivered to your inbox each morning.