Demonstrators for and against same-sex marriage hold signs during a rally in front of a federal courthouse in San Francisco on Monday. Demonstrators for and against same-sex marriage hold signs during a rally in front of a federal courthouse in San Francisco on Monday. (Paul Sakuma/Associated Press)A court case began in California on Monday marking the first federal trial in the U.S. in which a state ban on same-sex marriage is being challenged.

In 2008, opponents of gay marriage used a petition to force a referendum on whether gays should have the right to marry.

The Proposition 8 ban on same-sex marriage passed in November 2008 with 52 per cent support, over-ruling an earlier California Supreme Court decision that gays had the right to marry.

Two gay couples who haven't been allowed to marry are now suing the state in a court in San Francisco.

During opening statements, Chief U.S. District Judge Vaughn R. Walker interjected several times with questions.

"If California would simply get out of the marriage business and classify everyone as a domestic partnership, would that solve the problem?" Walker asked during the statement by former U.S. solicitor general Theodore Olson, who is representing gay couples.

Olson said he didn't think such a move would work politically.

Charles Cooper, the attorney representing the sponsors of Proposition 8, said it is too early to determine the impact gay marriage will have on traditional marriage.

"While the people of California have been steadfast in their defence of marriage, they have also been generous in their extending of the rights and benefits and protections of marriage to the gay and lesbian population," he said.

About 100 people demonstrated outside of the courthouse, the bulk of them same-sex marriage supporters.

The trial will likely last two to three weeks, and regardless of the outcome, is expected to be appealed to the U.S. Supreme Court.

Prior to the start of Monday's hearing, the U.S. Supreme Court ruled against broadcasting video of the case, at least until the top court has more time to consider the issue. The court ruled that video of the gay-rights case cannot be posted on YouTube.com

The court's broadcast order will be in place until at least Wednesday.

With files from The Associated Press