A judge in California has ruled that a law banning gay marriage in the state is unconstitutional.
San Francisco became the first US city to permit gay marriage
San Francisco Superior Court Judge Richard Kramer said the state had no rational reason for limiting marriage to a man and a woman.
Last year, California's Supreme Court annulled 4,000 gay marriages, which had taken place in defiance of state law.
Correspondents say this is not the end of the fight, but is a legal and moral victory for supporters of gay marriage.
Just over a year ago, San Francisco became the first place in the US where gay couples were able to marry after Mayor Gavin Newsom authorised same-sex marriage licences, claiming current legislation was discriminatory.
In August, the state's Supreme Court ruled the mayor had overstepped his authority and nullified the unions.
However, it sidestepped the issue of whether the state law defining marriage as between a man and a woman violated California's liberal constitution.
In his landmark decision on Monday, Judge Kramer ruled that the state law did violate a constitutional right to equal treatment for all citizens.
"Same-sex marriage cannot be prohibited solely because California has always done so before," Judge Kramer wrote, ruling on the case brought by Mr Newsom and 12 same-sex couples.
The issue is now expected to go back to California's Supreme Court.
Dave Chandler, who married his male partner last year, told the BBC he was "cautiously optimistic" the courts would eventually rule in favour of gay marriage.
The executive director for the National Center for Lesbian Rights, Kate Kendell, said: "It's such a historic and wonderful day to have the court rule as it did.
"The court was unequivocal in finding there is simply no tenable basis for not permitting lesbian and gay couples to marry."
One of the conservative groups that challenged the gay marriages in San Francisco, Liberty Counsel, vowed to appeal against the latest ruling.
"Marriage should not be undermined by the stroke of a pen from a single judge," said the group's president Mathew Staver. "To rule that there is no rational purpose to preserve marriage as the union of one man and one woman is ludicrous."
In November, voters in 11 US states overwhelmingly rejected gay marriages in referendums.