Activists for and against gay marriage gather outside California's supreme court
California's top court has begun debating a motion to overturn a ban on same-sex marriage, amid protests from activists on both sides of the debate.
The state's supreme court ruled last May that same-sex unions were legal.
But in November Californians voted to reimpose the ban via a constitutional amendment know as Proposition 8.
Gay-marriage supporters have now brought a motion challenging the legality of Proposition 8. The court has 90 days to issue a ruling.
Should the judges uphold Proposition 8, they will then have to determine whether 18,000 people who married while such unions were permitted can still be regarded as being legally wed.
The argument has polarised California, and much of the US.
Outside the San Francisco court, hundreds of people from all around the state gathered, waving placards and chanting slogans.
Dana Tibbits, an opponent of same-sex marriage, said she had driven 400 miles (650km) to join the crowd of Proposition 8 supporters, to ensure the voices of "7 million voters" would be heard.
The people ultimately decided
Ken Starr Lawyer
On the other side, law student Ronald Cruz said gay people were not prepared to take "second-class treatment" any more.
San Francisco Mayor Gavin Newsom, whose administration is seeking to overturn the ban, said the case represented a challenge to human rights.
"If the will of a simple majority can take away the rights of a minority at any time, then there's nothing to stop a subsequent majority taking away your rights... on religious or ethnic grounds," he said.
Supporters of Proposition 8, led by lawyer Ken Starr, believe the issue is about democracy.
In court submissions, Mr Starr is quoted as saying: "The people ultimately decided. Under our system of constitutional government, that is the end of the matter."
Last November's referendum called for the California constitution to be amended by adding the phrase: "Only marriage between a man and a woman is valid or recognised in California."
Some 52.5% of voters backed the initiative.
The measure was among 153 state-level proposals American voters were asked to decide on at the same time as the presidential election.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.