Marcio Jose Sanchez, Associated Press
Jeanne Rizzo, left, and Pali Cooper, middle, plaintiffs in the gay-marriage case, and niece Kate Cooper watch televised hearing in San Francisco.

SAN FRANCISCO — The national gay-marriage debate shifted to California on Tuesday, as the state's highest court heard more than 3 1/2 hours of arguments on the constitutionality of a voter-approved law banning same-sex marriage.

Gay rights advocates sued to overturn the ban four years ago after the court halted a months-long same-sex wedding spree that saw thousands of couples marry at City Hall.

"I think I speak for everybody when I say that this has been a long time coming and a day that has been eagerly anticipated," said City Attorney Dennis Herrera, who is representing the city in a lawsuit supporting gay marriage.

The court heard arguments in six cases that were filed after the court stopped the same-sex marriages in the winter of 2004. More than 4,000 couples exchanged vows at the direction of Mayor Gavin Newsom months before gay marriage became legal in Massachusetts, although the high court ultimately voided the unions.

The seven justices asked whether California already protects the civil rights of gay and lesbian couples through domestic partnerships. They also wanted to know if a ruling 60 years ago legalizing interracial marriages in the state gave them a precedent for striking down the same-sex marriage ban.

In briefs submitted to the court, same-sex marriage supporters argued that California's Constitution leaves no room for denying gays and lesbians the right to wed.