A federal judge Wednesday struck down Proposition 8, California's gay marriage ban, as unconstitutional.

Gay activists waited patiently outside San Francisco's federal courthouse for Chief U.S. District Judge Vaughn Walker's long-awaited ruling in Perry v. Schwarzenegger.

“Today's federal ruling strikes down a cruel and unfair constitutional amendment that should never have become law and affirms that the freedom to marry belongs to every American,” Evan Wolfson, executive director of Freedom to Marry, said.

“As the first court to strike down race restrictions on marriage said in 1948, 'the essence of the right to marry is freedom to join in marriage with the person of one's choice.' There is no gay exception in the Constitution to personal choice and the right to marry, and there is no good reason to continue excluding same-sex couples from marriage.”

The measure was approved in November 2008 after the state's Supreme Court had legalized the institution. Before voters narrowly reversed the ruling, about 18,000 gay and lesbian couples married.

The American Foundation for Equal Rights (AFER) had filed the challenge on behalf of two gay couples who had been denied the right to marry because of Proposition 8.

Conservative lawyer Ted Olson, who served as Solicitor General in the Bush administration, and David Boies argued the case before Walker over a 13-day trial in January. Walker heard closing arguments in June.

Opponents of gay marriage say they'll appeal the ruling.