ALBANY — Lawmakers voted late Friday to legalize same-sex marriage, making New York the largest state where gay and lesbian couples will be able to wed and giving the national gay-rights movement new momentum from the state where it was born.
The marriage bill, whose fate was uncertain until moments before the vote, was approved 33 to 29 in a packed but hushed Senate chamber. Four members of the Republican majority joined all but one Democrat in the Senate who supported the measure after an intense and emotional campaign aimed at the handful of lawmakers wrestling with a decision that divided their friends, their constituents and sometimes their own homes.
With his position still undeclared, Senator Mark J. Grisanti, a Republican from Buffalo who had sought office promising to oppose same-sex marriage, told his colleagues he had agonized for months before concluding he had been wrong.
“I apologize for those who feel offended,” Mr. Grisanti said, adding, “I cannot deny a person, a human being, a taxpayer, a worker, the people of my district and across this state, the State of New York, and those people who make this the great state that it is the same rights that I have with my wife.”
Senate approval was the final hurdle for the same-sex marriage legislation, which was approved last week by the Assembly. Gov. Andrew M. Cuomo signed the measure at 11:55 p.m., and the law will go into effect in 30 days, meaning that same-sex couples could begin marrying in New York by late July.
Passage of same-sex marriage here followed a daunting run of defeats in other states where voters barred same-sex marriage by legislative action, constitutional amendment or referendum. Just five states currently permit same-sex marriage: Connecticut, Iowa, Massachusetts, New Hampshire and Vermont, as well as the District of Columbia.
At around 10:30 p.m., moments after the vote was announced, Mr. Cuomo strode onto the Senate floor to wave at cheering supporters who had crowded into the galleries to watch. Trailed by two of his daughters, the governor greeted lawmakers, and paused to single out those Republicans who had defied the majority of their party to support the marriage bill.
“How do you feel?” he asked Senator James S. Alesi, a suburban Rochester Republican who voted against the measure in 2009 and was the first to break party ranks this year. “Feels good, doesn’t it?”
The approval of same-sex marriage represented a reversal of fortune for gay-rights advocates, who just two years ago suffered a humiliating defeat when a same-sex marriage bill was easily rejected by the Senate, which was then controlled by Democrats. This year, with the Senate controlled by Republicans, the odds against passage of same-sex marriage appeared long.
But the unexpected victory had a clear champion: Mr. Cuomo, a Democrat who pledged last year to support same-sex marriage but whose early months in office were dominated by intense battles with lawmakers and some labor unions over spending cuts.
Mr. Cuomo made same-sex marriage one of his top priorities for the year and deployed his top aide to coordinate the efforts of a half-dozen local gay-rights organizations whose feuding and disorganization had in part been blamed for the defeat two years ago.
The new coalition of same-sex marriage supporters brought in one of Mr. Cuomo’s trusted campaign operatives to supervise a $3 million television and radio campaign aimed at persuading several Republican and Democratic senators to drop their opposition.
For Senate Republicans, even bringing the measure to the floor was a freighted decision. Most of the Republicans firmly oppose same-sex marriage on moral grounds, and many of them also had political concerns, fearing that allowing same-sex marriage to pass on their watch would embitter conservative voters and cost the Republicans their one-seat majority in the Senate.
Leaders of the state’s Conservative Party, whose support many Republican lawmakers depend on to win election, warned that they would oppose in legislative elections next year any Republican senator who voted for same-sex marriage.
But after days of contentious discussion capped by a marathon nine-hour closed-door debate on Friday, Republicans came to a fateful decision: The full Senate would be allowed to vote on the bill, the majority leader, Dean G. Skelos, said Friday afternoon, and each member would be left to vote according to his or her conscience.
“The days of just bottling up things, and using these as excuses not to have votes — as far as I’m concerned as leader, it’s over with,” said Mr. Skelos, a Long Island Republican who voted against the bill.
Just before the marriage vote, lawmakers in the Senate and Assembly approved a broad package of major legislation that constituted the remainder of their agenda for the year. The bills included a cap on local property tax increases and a strengthening of New York’s rent regulation laws, as well as a five-year tuition increaseat the State University of New York and the City University of New York.
But Republican lawmakers spent much of the week negotiating changes to the marriage bill to protect religious institutions, especially those that oppose same-sex weddings. On Friday, the Assembly and the Senate approved those changes. But they were not enough to satisfy the measure’s staunchest opponents. In a joint statement, New York’s Catholic bishops assailed the vote.
“The passage by the Legislature of a bill to alter radically and forever humanity’s historic understanding of marriage leaves us deeply disappointed and troubled,” the bishops said.
Besides Mr. Alesi and Mr. Grisanti, the four Republicans who voted for the measure included Senators Stephen M. Saland from the Hudson Valley area and Roy J. McDonald of the capital region.
Just one lawmaker rose to speak against the bill: Rubén Díaz Sr. of the Bronx, the only Democratic senator to cast a no vote. Mr. Díaz, saying he was offended by the two-minute restrictions set on speeches, repeatedly interrupted the presiding officer who tried to limit the senator’s remarks, shouting, “You don’t want to hear me.”
“God, not Albany, has settled the definition of marriage, a long time ago,” Mr. Díaz said.
The legalization of same-sex marriage in the United States is a relatively recent goal of the gay-rights movement, but over the last few years, gay-rights organizers have placed it at the center of their agenda, steering money and muscle into dozens of state capitals in an often uphill effort to persuade lawmakers.
In New York, passage of the bill reflects rapidly evolving sentiment about same-sex unions. In 2004, according to a Quinnipiac poll, 37 percent of the state’s residents supported allowing same-sex couples to wed. This year, 58 percent of them did. Advocates moved aggressively this year to capitalize on that shift, flooding the district offices of wavering lawmakers with phone calls, e-mails and signed postcards from constituents who favored same-sex marriage, sometimes in bundles that numbered in the thousands.
Dozens more states have laws or constitutional amendments banning same-sex marriage. Many of them were approved in the past few years, as same-sex marriage moved to the front line of the culture war and politicians deployed the issue as a tool for energizing their base.
But New York could be a shift: It is now by far the largest state to grant legal recognition to same-sex weddings, and one that is home to a large, visible and politically influential gay community. Supporters of the measure described the victory in New York as especially symbolic — and poignant — because of its rich place in the history of gay rights: the movement’s foundational moment, in June 1969, was a riot against police inside the Stonewall Inn, a bar in the West Village.
In Albany, there was elation after the vote. But leading up to it, there were moments of tension and frustration. At one point, Senator Kevin S. Parker, a Brooklyn Democrat, erupted when he and other supporters learned they would not be allowed to make a floor speech.
“This is not right,” he yelled, before storming from the chamber.
During a brief recess during the voting, Senator Shirley L. Huntley, a Queens Democrat who had only recently come out in support of same sex marriage, strode from her seat to the back of the Senate chamber to congratulate Daniel J. O’Donnell, an openly gay Manhattan lawmaker who sponsored the legislation in the Assembly.
They hugged, and Assemblyman O’Donnell, standing with his longtime partner, began to tear up.
“We’re going to invite you to our wedding,” Mr. O’Donnell said. “Now we have to figure out how to pay for one.”