Mr. Rauch agreed with opponents that the polls may overstate support for same-sex marriage at this point. But unlike with other social movements, he said, gay rights advocates have been able to change attitudes by fusing a liberal goal with a conservative value. By asking for the same right to form families, he said, gay men and lesbians were rejecting a more libertine image that turned off many other Americans.

“We’re seeing a shift in public morality,” he said.

As the issue plays out in the political arena, it is also heading to a climactic moment at the Supreme Court, which may soon be asked to weigh in just as it has in the past on rights for blacks and women. Separate cases are heading toward the court challenging a voter-approved ban in California and the federal law Mr. Clinton signed, called the Defense of Marriage Act. Even before his statement this week, Mr. Obama had ordered the Justice Department not to defend the law.

The Supreme Court is a wild card in the same-sex marriage debate. Lawyers widely believe there would be four justices on each side, leaving Justice Anthony M. Kennedy as the deciding vote. Like other parts of society, the court has changed its thinking over the years, particularly as justices have come to know gay men and lesbians personally. The late Justice Lewis F. Powell Jr., who when writing a ruling upholding a sodomy ban told a secretly gay clerk that he had never “met a homosexual,” later said his decision was a mistake.

Yet Justice Kennedy may be reluctant to insert the court into the middle of such a highly charged social issue without a national consensus, according to legal analysts. And some advocates of gay rights worry that even if the court did rule in their favor, it would risk setting off a backlash.

Eric J. Segall, a law professor at Georgia State University, said that by enshrining abortion rights in Roe v. Wade, before the country was ready, the court energized a conservative movement that elevated Ronald Reagan and Newt Gingrich.

“When the court gets involved in trying to make progressive change, it fails miserably,” he said.

Others believe that the pace of change fueled by technology has changed that equation, and that younger Americans are not likely to change their views as they age. The issue does not fall clearly along ideological lines. Long before Mr. Obama, former Vice President Dick Cheney and the former Republican National Committee chairman Ken Mehlman endorsed same-sex marriage, while many black members of the clergy who normally form the bedrock of the Democratic coalition have lobbied against it.

One of the lead lawyers fighting California’s ban is Theodore B. Olson, who argued the Florida vote recount case that cleared the way for George W. Bush to become president.