After days of contentious negotiations and last-minute reversals by two Republican senators, New York became the sixth and largest state in the country to legalize gay marriage, breathing life into the national gay rights movement that had stalled over a nearly identical bill here two years ago.
Pending any court challenges, legal gay marriages can begin in New York by late July after Gov. Andrew Cuomo signed his bill into law just before midnight Friday.
At New York City's Stonewall Inn, the Greenwich Village pub that spawned the gay rights movement on a June night in 1969, Scott Redstone watched New York sign the historic same-sex marriage law with his partner of 29 years, and popped the question.
"I said, `Will you marry me?' And he said, `Of course!''' Redstone said he and Steven Knittweis walked home to pop open a bottle of Champagne.
New York becomes the sixth state where gay couples can wed, doubling the number of Americans living in a state with legal gay marriage.
"That's certainly going to have a ripple effect across the nation,'' said Ross Levi, executive director of the Empire State Pride Agenda. ``It's truly a historic night for love, our families, and democracy won.''
"We made a powerful statement,'' Cuomo said. "This state is at its finest when it is a beacon of social justice.''
The leading opponent, Democratic Sen. Ruben Diaz, was given only a few minutes to state his case during the Senate debate.
"God, not Albany, settled the issue of marriage a long time ago,'' said Diaz, a Bronx minister. "I'm sorry you are trying to take away my right to speak,'' he said. ``Why are you ashamed of what I have to say?''
The Catholic Bishops of New York said the law alters "radically and forever humanity's historic understanding of marriage.''
"We always treat our homosexual brothers and sisters with respect, dignity and love,'' the bishops said Friday. "We worry that both marriage and the family will be undermined by this tragic presumption of government in passing this legislation that attempts to redefine these cornerstones of civilization.''
Legal challenges of the law and political challenges aimed at the four Republicans who supported gay marriage in the 33-29 vote are expected. GOP senators endured several marathon sessions, combing through several standard but complex bills this week, before taking up the same-sex marriage bill Friday.
The bill came to the floor for a vote after an agreement was reached on more protections for religious groups that oppose gay marriage and feared discrimination lawsuits.
"State legislators should not decide society-shaping issues,'' said the Rev. Jason McGuire of New Yorkers for Constitutional Freedoms. He said his organization would work in next year's elections to defeat lawmakers who voted for the measure.
The big win for gay rights advocates is expected to galvanize the movement around the country after an almost identical bill was defeated here in 2009 and similar measures failed in 2010 in New Jersey and this year in Maryland and Rhode Island.
Jerry Nathan of Albany, who married his partner in Massachusetts, called the vote ``an incredible culmination of so much that's been going on for so many years it doesn't seem real yet.''
Ultimately, gay couples will be able to marry because of two previously undecided Republicans from upstate regions far more conservative than the New York City base of the gay rights movement.
Sen. Stephen Saland, 67, voted against a similar bill in 2009, helping kill the measure and dealing a blow to the national gay rights movement. On Friday night, gay marriage supporters wept in the Senate gallery as Saland explained how his strong, traditionally family upbringing led him to embrace legalizing gay marriage.
"While I understand that my vote will disappoint many, I also know my vote is a vote of conscience,'' Saland, of Poughkeepsie, said in a statement to The Associated Press before the vote. "I am doing the right thing in voting to support marriage equality.''
Also voting for the bill was freshman Sen. Mark Grisanti, a Buffalo Republican who also had been undecided. Grisanti said he could not deny anyone what he called basic rights.
"I apologize to those I offend,'' said Grisanti, a Roman Catholic. "But I believe you can be wiser today than yesterday. I believe this state needs to provide equal rights and protections for all its residents,'' he said.
A huge street party erupted outside the Stonewall Inn Friday night, with celebrants waving rainbow flags and dancing after the historic vote.
Watching the festivities from across the street was Sarah Ellis, who has been in a six-year relationship with her partner, Kristen Henderson. Ellis said the measure would enable them to get married in the fall. They have twin toddlers and live in Sea Cliff on Long Island.
"We've been waiting. We considered it for a long time, crossing the borders and going to other states,'' said Ellis, 39. "But until the state that we live in, that we pay taxes in, and we're part of that community, has equal rights and marriage equality, we were not going to do it.''
Also on Friday, the Empire State Building lit up with rainbow colors in honor of New York City's gay pride week. The lighting was previously scheduled but coincided with the law being enacted. A gay pride parade was scheduled for Sunday.
The bill makes New York only the third state, after Vermont and New Hampshire, to legalize marriage through a legislative act and without being forced to do so by a court.
Associated Press writers Michael Virtanen and Mike Hill in Albany and Karen Zraick in New York City contributed to this report.