A bill that would allow same-sex couples to marry won final passage in the California Assembly, marking the first time a state legislature in the United States has endorsed gay marriage.
The bill by San Francisco Democratic Assemblyman Mark Leno passed by a 41-35 vote, with the help of four Democrats who had not voted for it when the Assembly had previously taken up the legislation.
The state Senate backed the same bill last week.
"I couldn't do anything but keep going. It says something for being a little bit tenacious," Leno told cheering supporters.
Both the California Assembly and state Senate are controlled by Democrats. The office of Republican Gov. Arnold Schwarzenegger, who has previously opposed gay marriage, issued a statement saying he believes that the issue is best decided in the courts.
California voters in 2000 endorsed a ballot measure defining marriage as exclusively between a man and a woman, but that ban on same-sex marriages is facing court challenges.
The California Supreme Court has ruled invalid same-sex marriage licenses issued in 2004 by San Francisco Mayor Gavin Newsom, which helped fuel a national debate over gay marriage.
Opponents of gay marriage aim to place a measure on next year's ballot that would amend the state Constitution to include a ban.
"I think it's a sad day," Republican Assemblywoman Sharon Runner of Lancaster, California, said of the bill's passage.
"I think the people of California want us to do the business of jobs, the economy, education, illegal immigration, and today we had to spend several hours talking about an issue that the voters decided back five years ago, that marriage should be between a man and a woman ... I think it shows how out of touch the legislature is."
Massachusetts in 2004 became the first U.S. state to allow gay marriage, in response to a ruling by the state's Supreme Court. Massachusetts lawmakers are to vote next week on a proposed amendment to ban same-sex marriage, but the proposal is not expected to succeed.