WASHINGTON -- The struggle for African-Americans' rights, symbolized by the bloody 1965 Selma march, is as old as the nation. The effort for American women's rights began at Seneca Falls, N.Y., more than 150 years ago.
The modern fight for gay rights is, by contrast, less than a half-century old, dating from the 1969 Stonewall riots in New York. But this week, as the Supreme Court hears two landmark cases on same-sex marriage, the speed and scope of the movement are astonishing supporters.
"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," President Obama said in his Inaugural Address in January, in a moment of history for gay men and lesbians, who were included in such a speech for the first time. "Our journey is not complete until our gay brothers and sisters are treated like anyone else under the law."
The changes have been so swift that it is sometimes surprising to remember how many gay men and lesbians were until recently in the closet and how many hurdles there have been along the way. "We were all hiding," said former Representative Barney Frank, Democrat of Massachusetts, who in 1987 became the first member of Congress to voluntarily disclose his homosexuality. At the time, the public disapproval of homosexuality -- so powerful that gay men and lesbians hesitated to identify themselves, much less seek political change -- helped stunt the movement's emergence.
"This was a population too shy and fearful to even raise its hand, a group of people who had to start at zero in order to create their place in the nation's culture,'' Dudley Clendinen and Adam Nagourney wrote in "Out for Good," their 2001 history of the gay rights movement.
In the past century in American politics, the sources of that reticence were no mystery.
Judeo-Christian teachings, interpreted as condemning homosexuality, provided the backdrop for political debate in a nation more religious than others in the industrialized world. In the United States after World War II, the American Psychiatric Association lent medical and scientific credence to those views by labeling homosexuality a mental disorder.
But cultural changes unleashed in the 1960s began to erode those barriers.
Responding to the early stirrings in major cities like New York, Los Angeles and San Francisco, George McGovern became the first presidential candidate to identify himself with the movement by permitting openly gay speakers at the 1972 Democratic National Convention.
Four years later, Jimmy Carter, a Southern Baptist from Georgia, opposed discrimination against gay men and lesbians even as he marshaled support from evangelical Christians. During his presidency, Mr. Carter's public liaison, Midge Costanza, held the first formal White House meeting with gay activists.
But Mr. Carter lost in 1980 to an ascendant Republican Party that, under President Ronald Reagan, melded social and economic conservatism.
Before winning the White House, Mr. Reagan stood with gay activists in helping defeat a California ballot initiative that would have barred gay men and lesbians from teaching in public schools. During his presidency, however, Mr. Reagan kept his distance. Legislation extending civil rights protections to gay men and lesbians, introduced by liberal Democrats beginning in 1974, continued to languish in Congress.
The emergence of AIDS in the 1980s, however, lent the movement new energy and urgency. The epidemic propelled many closeted gay men and lesbians to begin identifying themselves publicly and raised the stakes for elected officials who were suddenly facing votes over the use of tax money to respond to a public health crisis.
Lawmakers aligned with gay activists began making alliances on Capitol Hill that had been impossible on more abstract issues of gay rights.
"When it was purely symbolic, I couldn't get them," Mr. Frank recalled of trying to round up supporters for gay rights. "When people's lives were at stake, I'd get, 'Oh, all right, I guess I have to vote with you.'"
President Bill Clinton, the first baby boomer president, pulled the movement further into the political mainstream. He attended a high-profile gay-sponsored fund-raiser, spotlighted AIDS at his 1992 convention and promised an executive order barring discrimination against gay men and lesbians in the military.
"He brought us inside the Democratic Party," said David Mixner, an old friend of Mr. Clinton's from the opposition to the Vietnam War who became his adviser and ambassador to the gay rights movement.
But victories remained intermittent. Democrats lost a landslide midterm election in 1994, leading Mr. Clinton to strike a more conservative tone.
In 1996, he infuriated gay supporters by signing the Defense of Marriage Act, whose constitutionality is being considered this week in one of the same-sex marriage cases before the Supreme Court. The law limited the definition of marriage to unions between a man and a woman.
Mr. Clinton's stance tracked American public opinion, which continued to distinguish gay rights from other civil rights causes. In a 1996 Gallup survey, 68 percent of respondents opposed legal recognition for same-sex marriages. In early 1997, Gallup found a mirror image on interracial marriage, with 64 percent expressing approval.
Public resistance obscured quieter advances elsewhere. Labor unions had long been the movement's "strongest ally" in seeking protections for gay workers, said Gregory King, an official at the American Federation of County, State and Municipal Employees. And as increasing numbers of gay employees became open about their sexuality, major corporations extended benefit programs to cover same-sex couples.
"The private sector was always ahead of the politicians," said Hilary Rosen, a Washington public relations consultant active in gay rights causes. So was popular culture, particularly television, which in recent years has presented an array of gay figures in a positive light.
Now those developments, and a rising generation of socially tolerant younger voters who do not regard same-sex marriage as controversial, have turned public opinion on its head.
In November 2012, Gallup found that 53 percent of respondents favored legal recognition of same-sex marriages. A survey last week showed that 54 percent backed benefits for federal employees married to same-sex partners.
Such attitudes have produced a political recalibration that alters the debate, whatever the Supreme Court rules on same-sex marriage rights.
Former Secretary of State Hillary Rodham Clinton, 17 years after her husband backed the Defense of Marriage Act, recently posted a video supporting same-sex marriage. No other potential 2016 Democratic presidential rival has staked an opposing view, or is expected to. Senator Rob Portman of Ohio, a prospect for the Republican presidential ticket, announced that he supported same-sex marriage after learning that his adult son was gay.
The pace of change continues to surprise gay rights supporters.
In his youth, Mr. Frank said, he realized he was drawn personally to men and professionally to government. He assumed the former would impede the latter.
"At this point," he concluded, "I think my continued sexual attraction to men is more politically acceptable than my attraction to government."
This article originally appeared in The New York Times.