In New York, Maira Garcia, right, and Maria Vargas wait in line to get married at the Brooklyn City Clerk¿s office last year.

In New York, Maira Garcia, right, and Maria Vargas wait in line to get married at the Brooklyn City Clerk¿s office last year. (Mario Tama / Getty Images)

President Obama's announcement Wednesday that he was done "evolving" and now supports same-sex marriage was, in retrospect, inevitable. Vice President Joe Biden made it so Sunday, when he remarked almost casually that he had grown "comfortable" with gay marriage.

Biden's comfort level made Obama the nation's least comfortable politician, tied up in a knot of convoluted positions that he had hoped voters on both sides would overlook.

He opposed state laws like the one passed in North Carolina this week denying same-sex couples the right to wed. But even as he opposed anti-marriage laws, he didn't support pro-marriage laws.

It was an awkward straddle, but as long as the issue was out of the spotlight, the president intended to stick with it. Biden's candor made that impossible. The spectacle of the president and vice president disagreeing got in the way of the Obama campaign's planned rollout this week of its basic economic message. And the issue was going to come up again and again — at Thursday night's fundraiser at George Clooney's home in Los Angeles, at the Democratic National Convention in September and at lots of events in between. The Obama campaign understands at least one basic rule of politics: When you're in a hole, stop digging and find a way out.

Still, I'm willing to cut Obama some slack on this issue. Like a lot of Americans, he was blindsided by the astonishing pace of change in public opinion on an issue that seemed almost immovable only a few years ago.

As recently as 2004, a Pew Research Center poll found that 60% of Americans were opposed to allowing same-sex couples to marry, with 36% strongly opposed. By last month, those opposed had shrunk to 43%, with 22% strongly opposed.

"It's difficult to think of any other issue on which that kind of change has occurred so quickly," Pew Center President Andrew Kohut told me Tuesday.

What changed? A huge factor is generational, Kohut says. Young people — those born after 1980, who grew up seeing sympathetic gay characters on television — are in favor of gay marriage by a resounding 63%. Their grandparents, the pre-baby-boom elders born before 1946, are still mostly opposed, although their opposition has weakened too.

Another explanation comes from Indiana University sociologist Brian Powell, who led a research project on the issue funded by the Russell Sage Foundation; Powell credits what might be called the "Aunt Martha effect." Powell's surveys found that an increasing number of Americans say they have gay friends or relatives, and those who know gay people are more likely to favor gay marriage. The change, Powell says, wasn't that people acquired new gay relatives; rather, their gay relatives were more likely to be open about their sexuality. And it turns out that once you've learned that your beloved Aunt Martha is a lesbian, you're more likely to feel sympathetic toward gay people in general.

But that wave of change wasn't visible in advance. In 2004, Republican strategist Karl Rove exploited fear of gay marriage as a means to drive socially conservative Republicans to the polls and to divide working-class Democrats. That year's elections included no fewer than 13 state ballot measures to outlaw gay marriage, and the voters who turned out to support them helpedGeorge W. Bush win a second term. As it happens, that was also the year an Illinois state legislator named Barack Obama ran for the U.S. Senate.

In 2004, the "safe" position for a Democratic politician on this issue was to support civil unions. That was supposed to be the judicious middle ground: equal legal rights for same-sex couples but without the polarizing word "marriage."

And that was the position adopted by then-Sen. Obama, a politician whose first instinct is often to look for the middle ground. Among other things, he knew that most religiously observant African American voters, a big chunk of his base of support, were conservative on the issue.

As president he kept his promises to take practical steps toward equal rights for gay people, including an end to the military's policy of "don't ask, don't tell." But on gay marriage — a largely symbolic question for a president because marriage is mostly under state jurisdiction — he remained in limbo.

The problem, of course, was that public opinion was changing, and Obama's safe middle ground was melting like a polar bear's iceberg.

The politics still aren't simple. Gay marriage is more popular than it was in 2004, but the shift in public opinion may have plateaued. The Gallup Poll found this month that 50% of Americans believe same-sex marriages should be legal, but that was down from 53% a year ago.

African Americans and Latinos are still less hospitable to gay marriage than white voters, and Obama needs strong support from those minority groups if he is to win in November.

Swing states are a problem for the president too. The numbers in national polls include supporters of gay marriage in states where it's already legal, like Massachusetts and New York, places Obama already has more votes there than he needs. Where he needs help is places like Ohio, Florida and Virginia, all three of which have passed gay marriage bans.

Only this week, North Carolina, a state Obama won in 2008 (and briefly hoped to win again this year), voted by a whopping 60% to approve a state constitutional amendment that outlaws not only gay marriage but also other forms of domestic partnership.

To Obama and his political advisors, it seemed to make sense, as a matter of practical politics, for the president to try to skate through this election year in his unfinished state of evolution. As long as most of his gay supporters were willing to put up with it, what was the downside?

Biden made that impossible — and at that point, Obama responded quickly. He sounded thoughtful in his interview with ABC News' Robin Roberts. He talked about conversations with "friends and family and neighbors," and with his daughters, "Malia and Sasha — they've got friends whose parents are same-sex couples." He talked about gay members of his own staff "in incredibly committed monogamous relationships."

And he talked about how knowing those people and having those conversations prompted him to change his views — just like a lot of other Americans.

Robert M. Gates, the former U.S. Defense secretary and current Boy Scouts of America president, earlier today urged the youth organization to, essentially, grow up and allow gays to serve in leadership roles.

The U.S. Supreme Court will rule this month in Obergefell vs. Hodges, the case that could give same-sex couples across America the freedom to marry. The majority of states already have marriage equality, and the issue has lost salience for some. But the Obergefell decision still matters. In several...

Last week, UCLA geneticist and pediatrician Eric Vilain and Northwestern University psychologist Michael Bailey took to The Times' Op-Ed page to discuss the development of transgender and gender dysphoric youths. As the headline suggests, their piece was novel in that it was directed at the parents...

At Sunday night’s Golden Globe awards, Jeffrey Tambor paid respect to his cast and crew, dedicated his award and performance of Maura Pfefferman on Amazon’s “Transparent” to the transgender community and showed Hollywood what it means to be an ally.

If you happen to pay extremely close attention to internecine debates within the LGBT community, you may know that not everyone lined up in favor of pursuing marriage equality at the federal level. Much of the debate over the last decade was about strategy — avoiding backlash for premature demands,...

On Tuesday, the Supreme Court will hear oral arguments in the Ohio case of Obergefell vs. Hodges, as well as three related cases from Kentucky, Michigan and Tennessee. The court is then expected to decide whether the Constitution requires states to grant gay people the same rights in marriage as...