SAN FRANCISCO (Reuters) - The attorney representing two same-sex couples who were denied a right to wed in California said on Thursday he expected the case to end up before the U.S. Supreme Court, which has yet to hear a case on the gay marriage issue.

“When it does get to the United States Supreme Court, we expect to win,” Theodore Olson, who was solicitor general under former President George W. Bush, told reporters after the first hearing on federal lawsuit that was filed in May.

A high court ruling potentially could trump state laws prohibiting same-sex unions. Five out of 50 U.S. states have legalized gay marriage, which opponents view as a threat to what they view as the traditional family.

U.S. District Judge Vaughn Walker used the preliminary hearing scheduled in the case to urge both parties to move to trial as swiftly as possible.

Walker similarly predicted the closely watched proceedings in his courtroom were “only a prelude to what happens later.”

“I’m reasonably sure given the issues involved and the personalities in this courtroom this case is only touching down in this court,” Walker said. “It will have a life after this court.”

The battle over gay marriage has been especially arduous in California, which has historically stood at the forefront of changing social mores.

The federal lawsuit that claims California denies gays their constitutional right to marry was filed days before the state’s top court backed a ban on gay marriage. Proposition 8, a state constitutional amendment that limits marriage to man-and-woman couples, was passed by voters in November.

In May 2008, California’s Supreme Court struck down a state law barring same-sex marriage, leading 18,000 same-sex couples to marry. Those marriages remain valid, the same court ruled in May, even as it upheld the voter-backed ban on gay marriage.

In taking the case, Olson joined with former opponent David Boies, a lawyer who represented Vice President Al Gore in the 2000 election vote recount leading to Bush’s presidency.