Washington (CNN) -- President Barack Obama once believed marriage was only between a man and a woman.
He then backed civil unions for gay and lesbian couples, granting them many of the same rights and privileges as married heterosexuals.
Now he firmly supports a constitutional right that has put him at odds with many social conservatives.
It is a personal and political evolution that in many ways reflects the country as a whole. Shifting public opinion and old fights over judicial power are at the nexus of perhaps the most important social issue the high court has addressed in recent years: same-sex marriage.
There about 120,000 legally married homosexual couples in the United States. Many thousands more seek the same thing. But it may be 10 people who have the power to force immediate, real change on this legal, political, and social issue: the nine justices and Obama himself.
How U.S. political leaders and the Supreme Court act in coming months could set the template for years on a contentious topic that shows no sign of cooling.
"The argument that the Obama administration has made is the Supreme Court should look at these laws very carefully because gays and lesbians are a group that have been subject to discrimination in the past and will be subject to discrimination going forward," said Amy Howe, a legal analyst and editor of SCOTUSblog.com.
"So the Supreme Court would need to subject these laws to what we call a very stringent standard of review" balancing the government's justification for enacting them, she added.
Two separate appeals to be argued Tuesday and Wednesday will once again put the high court at center stage, a contentious encore to its summer ruling upholding the health care reform law championed by Obama.
Nine states and the District of Columbia allow same-sex marriage, including Washington, Maryland, Maine, Iowa, New Hampshire, Vermont, Massachusetts, Connecticut, and New York. Another nine have civil union or strong domestic partnership laws.
The high court will consider two appeals.
The first involves the federal Defense of Marriage Act. DOMA is a 1996 law that defines marriage between one man and one woman. That means federal tax, Social Security, pension, and bankruptcy benefits, family medical leave protections, and other provisions do not apply to gay and lesbian couples.
Edie Windsor, an 84-year-old New York woman, is the key plaintiff. She was forced to pay more than $363,000 in extra estate taxes when her longtime spouse, Thea Spyer, died.
The second case involves California's Proposition 8, a 2008 referendum that abolished same-sex marriage after the state's highest court ruled it legal.
The Supreme Court is being asked to establish same-sex marriage as a constitutional right, but could also decide a more narrower question: Whether a state can revoke that right through referendum once it has already been recognized.
Running for the Illinois state senate in 1998, Obama said he was "undecided" about whether to legalize same-sex marriage. Fast-forward six years to when he ran for U.S. Senate. He then declared a belief that marriage is between a man and a woman.
The stance began an internal process over time that was by his admission, anything but smooth.
"My feelings about this are constantly evolving. I struggle with this," he said in 2010, two years into his presidency.
"At this point, what I've said is that my baseline is a strong civil union that provides them the protections and the legal rights that married couples have," Obama said at the time.
Eight such states have civil union or strong domestic partnership laws-- Delaware, Hawaii, Illinois, Nevada, New Jersey, Oregon, and Rhode Island. But it is the California case that really has drawn the Obama administration into the fight.
Obama signaled earlier this month he was prepared to assert a vigorous constitutional right to marriage, but confine it for now only to the Proposition 8 matter and perhaps to the seven other states with civil union laws like California's.
The Justice Department argues civil union and domestic partnership laws may themselves be unconstitutional and that those states should go all the way and grant same-sex couples full marriage rights.
It's called the eight-state strategy.
"The object of California's establishment of the legal relationship of domestic partnership is to grant committed same-sex couples rights equivalent to those accorded a married couple. But Proposition 8, by depriving same-sex couples of the right to marry, denies them the dignity, respect, and stature accorded similarly situated opposite-sex couples under state law," the Justice Department said in its brief on the case.
Gay rights groups had privately urged Obama and his top aides to go beyond his previous personal rhetoric in support of the right, and come down "on the side of history" in this legal struggle.
This was all set in motion in the heat of the president's re-election campaign in what government sources described as a quickly arranged political strategy.
"At a certain point, I've just concluded that for me personally it is important for me to go ahead and affirm that I think same-sex couples should be able to get married," Obama told ABC News.
Perhaps bowing to political caution in an election year, Obama explained he "hesitated on gay marriage" partly because he thought civil unions "would be sufficient."
"I was sensitive to the fact that for a lot of people, the word marriage was something that invokes very powerful traditions and religious beliefs," he said.
A new national survey indicates a small majority of Americans backs such marriages but there are generational and partisan divides as well as a gender gap.
According to a CNN/ORC International poll, 53 percent of the public think marriages between gay or lesbian couples should be legally recognized as valid, with 44 percent opposed.
"There are big differences among younger and older Americans, with the youngest age group twice as likely than senior citizens to support same-sex marriage," says CNN Polling Director Keating Holland. "Women are also more likely to call for legal recognition of gay marriage than men. And only three in ten Americans who attend religious services every week support same-sex marriage while six in ten Americans who don't attend church weekly feel that way."
Former President Bill Clinton, who signed the marriage law into effect 17 years ago, said this month he now backs the right of homosexuals to marry. So, too, does his wife, former Secretary of State Hillary Clinton, a possible Democratic presidential candidate in 2016.
But others on the right say society benefits from preserving a view of marriage that has been in place for centuries.
The authors of a new book, "What is Marriage? Man and Woman: A Defense," say, "Redefining marriage would, by further eroding its central norms, weaken an institution that has already been battered by widespread divorce, out-of-wedlock child bearing and the like."
Academics Robert George, Sherif Girgis, and Ryan Anderson say marriage should be more than "commitment based on emotional companionship," and has been practiced for a specific reason throughout this country's history.
"All human beings are equal in dignity and should be equal before the law. But equality only forbids arbitrary distinctions," they argue. "And there is nothing arbitrary about maximizing the chances that children will know the love of their biological parents in a committed and exclusive bond. A strong marriage culture serves children, families and society by encouraging the ideal of giving kids both a mom and a dad."
The DOMA and Prop 8 cases will test the delicate line over constitutional limits from both congressional, presidential, and judicial power.
All nine justices will have an equal voice in both oral argument and an eventual ruling, but it may be one member of the court whose views may count most in the high-stakes quest for five votes.
Justice Anthony Kennedy authored the landmark 1996 Romer v. Evans ruling, striking down a Colorado constitutional amendment that forbid local communities from passing laws banning discrimination against gays.
The moderate-conservative wrote for the 6-3 majority, rejecting the state's argument the law only blocked gay people from receiving preferential treatment or "special rights."
In dissent Justice Antonin Scalia criticized the court for placing what he said was "the prestige of this institution behind the proposition that opposition to homosexuality is as reprehensible as racial or religious bias."
In 2003, Kennedy authored the court's decision overturning state laws criminalizing homosexual sodomy.
At the time though, he cautioned the court was not endorsing the idea of same-sex marriage, saying the private conduct case at hand "does not involve whether the government must give formal recognition to any relationship that homosexual persons seek to enter."
That caution was further articulated this month by Kennedy, when he said some issues are best left to the other branches.
"I think it's a serious problem. A democracy should not be dependent for its major decisions on what nine unelected people from a narrow legal background have to say," Kennedy said.
By patiently letting legislatures and the voters decide the social and practical implications of same-sex marriage over the past decade, the high court is now poised to perhaps offer the final word on tricky constitutional questions.
The split 5-4 conservative-liberal bench has the option of ruling broadly or narrowly-- perhaps taking a series of incremental cases over a period years, building political momentum and public confidence in the process.
The Prop 8 case is Hollingsworth v. Perry (12-144). The DOMA case is U.S. v. Windsor (12-307).