New York will become the sixth state where gay couples can wed and the biggest by far.
Gay rights advocates are hoping the vote will galvanize the movement around the country and help it regain momentum 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.
Though New York is a relative latecomer in allowing gay marriage, it is considered an important prize for advocates, given the state's size and New York City's international stature and its role as the birthplace of the gay rights movement, which is considered to have started with the Stonewall riots in Greenwich Village in 1969.
The New York bill cleared the Republican-controlled state Senate on a 33-29 vote. The Democrat-led Assembly, which passed a different version last week, is expected to pass the new version with stronger religious exemptions and Democratic Gov. Andrew Cuomo, who campaigned on the issue last year, has promised to sign it. Same-sex couples can begin marrying begin 30 days after that. The passage of New York's legislation was made possible in two Republican senators who had been undecided.
Sen. Stephen Saland voted against a similar bill in 2009, helping kill the measure and dealing a blow to the national gay rights movement.
"While I understand that my vote will disappoint many, I also know my vote is a vote of conscience," Saland said in a statement to The Associated Press before the vote. "I am doing the right thing in voting to support marriage equality."
Gay couples in gallery wept during Saland's speech.