San Francisco: California performed its first legally recognized same-sex weddings on Monday and opened its doors to gay and lesbian couples from around the country, a move likely to challenge other states that define marriage as between a man and a woman.

Octogenarians Del Martin and Phyllis Lyon took the first vows in San Francisco's ornate City Hall in a ceremony presided over by Mayor Gavin Newsom.

The two, who have been together for more than 50 years, were also the first to be married in 2004, during the "Winter of Love" when about 4,000 same-sex couples exchanged vows. Courts overturned those particular unions, but last month the state Supreme Court struck down a ban on homosexual marriage. That ruling went into effect late on Monday.

"When we first got together, we weren't really thinking about getting married," Lyon said to a small crowd that laughed, cheered, and threw red rose petals.

Southern California couple Robin Tyler and Diane Olson, two of the plaintiffs in the state Supreme Court battle, exchanged vows in Beverly Hills, where for years they had petitioned unsuccessfully for a marriage license.

"Here is the final ending to our beautiful story - 'And they lived happily ever after'," Tyler said. Nearby, a supporter waived a placard labeled 'Finally.'

Still, opponents aim to fight back in November when Californians will vote whether to change the state constitution to define marriage as between a man and a woman - conservative Christians have vowed to get voters to the polls.

California is the second state, after Massachusetts, to marry same-sex couples, but it is the first ready to grant licenses to couples from any state. Gay marriage is rejected by 45 states, although New York will honour California unions.