Revelers celebrate the passage of a bill legalizing same-sex marriage in New York State outside the Stonewall Inn on Christopher St, Friday. The measure passed, 33-29, following weeks of tense delays and debate. AP

ALBANY, New York—Same-sex marriage is now legal in New York after Governor Andrew Cuomo signed a bill that was narrowly passed by state lawmakers Friday, handing activists a breakthrough victory in the state where the American gay rights movement was born.

New York becomes 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 elsewhere in recent years.

The effects of the legislation could be felt well beyond New York: Unlike Massachusetts, which pioneered gay marriage in 2004, New York has no residency requirement for obtaining a marriage license, meaning the state could become a magnet for gay couples across the country who want to have a wedding in Central Park or that honeymoon hot spot of yore, Niagara Falls.

New York, the third most populous state, will join Connecticut, Iowa, Massachusetts, New Hampshire, Vermont and the Washington capital district in allowing same-sex couples to wed.

“Once this is signed into law, the population of the United States living under marriage equality doubles,” said Ross Levi, executive director of the Empire State Pride Agenda in an interview. “That’s certainly going to have a ripple effect across the nation. It’s truly a historic night for love, our families, and democracy won.”

Though New York is a relative latecomer in allowing gay marriage, it is considered an important prize for advocates, given the state’s size, New York City’s international stature. The gay rights movement is considered to have started with the Stonewall riots in New York City’s Greenwich Village in 1969.

A huge street party erupted outside the Stonewall Inn Friday night, with celebrants waving rainbow flags and dancing after the historic vote. They included Sarah Ellis, who has been in a six-year relationship with her partner, Kristen Henderson, saying 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.”

A number of celebrities also praised the vote. Lady Gaga tweeted that she couldn’t stop crying, while Pink tweeted, “congratulations!!!!!!!!! About time!”

The New York bill cleared the Republican-controlled Senate on a 33-29 vote. The Democrat-led Assembly, which previously approved the bill, passed the Senate’s stronger religious exemptions in the measure Friday, and Democratic Gov. Andrew Cuomo, who campaigned on the issue last year, has promised to sign it. Same-sex couples can begin marrying 30 days after that.

Cuomo made a surprise and triumphant walk around the Senate, introduced like a rock star by his lieutenant governor, Robert Duffy. The filled upper gallery shouted down to Cuomo, “Thank you!”

The passage of New York’s legislation was made possible by two Republican senators who had been undecided.

Senator 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 wept in the gallery during Saland’s speech.

“We are leaders and we join other proud states that recognize our families and the battle will now go on in other states,” said Senator Thomas Duane, a Democrat.

The climactic vote came after more than a week of stop-and-start negotiations, rumors, closed-door meetings and frustration on the part of advocates. Online discussions took on a nasty turn with insults and vulgarities peppering the screens of opponents and supporters alike and security was beefed up in the Capitol to give senators easier passage to and from their conference room.

The sticking point over the past few days: Republican demands for stronger legal protections for religious groups that fear they will be hit with discrimination lawsuits if they refuse to allow their facilities to be used for gay weddings.

On Thursday night, Obama encouraged lawmakers to support gay rights during a fundraiser with New York City’s gay community. The vote also is sure to charge up annual gay pride events this weekend, culminating with parades Sunday in New York City, San Francisco and other cities.

Despite New York City’s liberal Democratic politics and large and vocal gay community, previous efforts to legalize same-sex marriage failed over the past several years, in part because the rest of the state is more conservative than the city.

The bill’s success this time reflected the powerful support of Cuomo and perhaps a change in public attitudes. Opinion polls for the first time are showing majority support for same-sex marriage, and Congress recently repealed the “don’t ask, don’t tell” policy that barred gays from serving openly in the military.

In the week leading up to the vote in New York, some Republicans who opposed the bill in 2009 came forward to say they were supporting it for reasons of conscience and a duty to ensure civil rights.

Pressure to vote for gay marriage also came from celebrities, athletes and New York City Mayor Michael Bloomberg, the Republican-turned-independent who has long used his own fortune to help bankroll Republican campaigns and who personally lobbied some undecided lawmakers. Lady Gaga has been urging her 11 million Twitter followers to call New York senators in support of the bill.

While the support of the Assembly was never in doubt, it took days of furious deal-making to secure two Republican votes needed for passage in the closely divided Senate.

Representatives of the Roman Catholic Church, Orthodox rabbis and other conservative religious leaders fought the measure, and their Republican allies pressed hard for stronger legal protections for religious organizations.

Each side of the debate was funded by more than $1 million from national and state advocates who waged media blitzes and promised campaign cash for lawmakers who sided with them.

But Republican senators said it was Cuomo’s passionate appeals in the governor’s mansion on Monday night and in closed-door, individual meetings that were perhaps most persuasive.

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.

For five months in 2008, gay marriage was legal in California, the biggest state in population, and 18,000 same-sex couples rushed to tie the knot there before voters overturned the state Supreme Court ruling that allowed the practice. The constitutionality of California’s ban is now before a federal appeals court.

Complete stories on our Digital Edition newsstand for tablets, netbooks and mobile phones; 14-issue free trial. About to step out? Get breaking alerts on your mobile.phone. Text ON INQ BREAKING to 4467, for Globe, Smart and Sun subscribers in the Philippines.

Disclaimer: The comments uploaded on this site do not necessarily represent or reflect the views of management and owner of INQUIRER.net. We reserve the right to exclude comments that we deem to be inconsistent with our editorial standards.