Several Supreme Court justices indicated they might lean toward issuing a narrow ruling on gay marriage during a landmark hearing Tuesday on California's same-sex marriage ban, even as lawyers for the plaintiffs argued for legalizing the unions nationally.

The case heard Tuesday, the first of two gay-marriage cases the high court is weighing this week, centered on California's Proposition 8 ban on same-sex marriage but could have national implications. If the justices choose to rule broadly, they could overturn Prop 8 and in doing so invalidate every other restriction on gay marriage in the country.

But the justices suggested Tuesday they could decide the case without issuing a ruling that ripples through all 50 states.

Several justices, including some liberals who seemed open to gay marriage, raised doubts Tuesday that the case was properly before them. Justice Anthony Kennedy, the potentially decisive vote on a closely divided court, suggested that the court could dismiss the case with no ruling at all.

Such an outcome would almost certainly allow gay marriages to resume in California but would have no impact elsewhere.

Click to listen to the Supreme Court arguments in the Prop 8 case.

Kennedy said he feared the court would go into "uncharted waters" if it embraced arguments advanced by gay marriage supporters. But lawyer Theodore Olson, representing two same-sex couples, said that the court similarly ventured into the unknown in 1967 when it struck down bans on interracial marriage in 16 states.

Kennedy challenged the accuracy of that comment by noting that other countries had had interracial marriages for hundreds of years.

There was no majority apparent for any particular outcome and many doubts expressed about the arguments advanced by lawyers for the opponents of gay marriage in California, by the supporters and by the Obama administration, which is in favor of same-sex marriage rights.

Chief Justice John Roberts told Olson that it seemed supporters of gay marriage were trying to change the meaning of the word "marriage" by including same-sex couples.

Lawyers representing supporters of the California ban known as Proposition 8 argued that the court should not override the democratic process and impose a judicial solution that would redefine marriage in the some 40 states that do not allow same-sex couples to wed.

The case attracted high interest. Spectators were waiting in line since Thursday for the chance at being in the room while the two sides try to sway the court.

By ruling broadly, the court could overturn every state constitutional provision and law banning same-sex marriages. Or, they could set back the gay marriage movement by upholding California's ban and continuing to leave the issue up to the states. By choosing the middle route, though, the justices could dismiss the case -- a move likely to let gay marriages resume in California, with no impact anywhere else.

The case before the high court came together four years ago when the two couples agreed to be the named plaintiffs and become the public faces of a well-funded, high-profile effort to challenge Proposition 8 in the courts.

The fight began in 2004 when San Francisco Mayor Gavin Newsom ordered city officials to issue marriage licenses. Six months later, the state Supreme Court invalidated the same-sex unions. Less than four years later, however, the same state court overturned California's prohibition on same-sex unions.

Then, in the same election that put President Obama in the White House in 2008, California voters approved Proposition 8, undoing the court ruling and defining marriage as the union of a man and a woman.

The ballot measure halted same-sex unions in California. Roughly 18,000 couples were wed in the nearly five months that same-sex marriage was legal and those marriages remain valid in California.

The high-profile case has brought together two one-time Supreme Court opponents. Republican Theodore Olson and Democrat David Boies are leading the legal team representing the same-sex couples.

They argued against each other in the Bush v. Gore case that settled the disputed 2000 presidential election in favor of George W. Bush. Opposing them is Charles Cooper, Olson's onetime colleague at the Justice Department in the Reagan administration.

On Wednesday the court will consider a provision that defines marriage as between a man and a woman for the purpose of deciding who can receive a range of federal benefits, as part of the 1996 Defense of Marriage Act.

The arguments come at a time of changing views on the issue. Support for gay marriage is becoming a mainstream Democratic position and the issue is causing a sharp divide among Republicans.

The issue has created fault lines within the Republican Party, as some prominent members drop their opposition to same-sex marriage while others stiffen it.

Gary Bauer, president of American Values, told "Fox News Sunday" that proponents of gay marriage are effectively asking "for unelected judges to deny the people of the states the right to decide what marriage is in their state."

Bauer said he would prefer that every state bar gay marriage. But, acknowledging that's not likely, he said the court should let the states decide.

However Nicolle Wallace, a former adviser to former President George W. Bush and to the 2008 McCain campaign, said those arguing against Prop 8 are in fact using a "conservative legal argument."

"They will basically lay out the conservative case that there is not any place in the Constitution that allows for a different set of rules for a different class of people," she told "Fox News Sunday." "There's also a moral imperative here. If you believe, if you value and treasure and revere the institution of marriage, then you should want every family unit to be really wrapped in marriage."

Top Democrats who previously opposed same-sex marriage -- and had taken the more moderate position of supporting civil unions -- have in recent months and years shifted course. President Obama announced his support for gay marriage in the months leading up to the presidential election. Hillary Clinton also recently followed suit.

But Republicans have also been crossing to the pro-gay marriage side. Wallace is among dozens of Republicans who filed a brief in the Supreme Court case arguing for Prop 8 to be overturned. And Sen. Rob Portman, R-Ohio, publicly reversed his position on the issue after his son came out as gay.

The position shifts, though, do not signal a party-wide change of heart. Many Republicans would still prefer the issue be left up to the states and are encouraging the high court justices to rule narrowly.

"They would be far better off to decide these two cases on the narrowest possible grounds," former House Speaker Newt Gingrich said Sunday. A sweeping decision against gay marriage, he said, would be a "huge mistake" that would "undermine respect for the judiciary."

Americans as a whole are likewise divided. A Fox News poll released Thursday showed 49 percent of voters favor legalizing gay marriage, while 46 percent oppose it.

That marks a shift since the question was first asked in 2003 -- when 32 percent said gay marriage should be legal, and 58 percent opposed it.

Support for gay marriage has grown the most among Democrats, and self-described moderates and independents. Still, support for gay marriage rose by 10 points among Republicans over the past decade, according to the Fox News polling.

Gay marriage has been approved in nine states -- Connecticut, Iowa, Maine, Maryland, Massachusetts, New Hampshire, New York, Vermont, Washington -- and the District of Columbia. But 31 states have amended their constitutions to prohibit same-sex marriage. North Carolina was the most recent example last May.

The Associated Press contributed to this report.