Gay couples and proponents of gay rights have a reason to celebrate tonight, as the New York State Senate has passed a bill that allows same sex marriage.

New York will be the sixth, and largest, state in the union to adopt gay marriage. Governor Cuomo signed the bill into law at 11:15pm on Friday, which means the law will take effect on July 24, 2011.

The decision, which passed 33-29, was the culmination of weeks of contentious debate and negotiations between Governor Cuomo and the GOP-controlled Senate. After the bill passed in the Assembly, it was unclear if the bill had secured enough votes to pass in the Senate. When a few notable undecideds joined the cause --including Republican Roy McDonald who famously defended his decision, saying "fuck it, I don't care what you think. I'm trying to do the right thing" -- the scale in favor of gay marriage seemed to tip.

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.

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

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.

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, 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."

"I am spellbound. I'm so exhausted and so proud that the New York State Senate finally stood on the right side of history," said Queens teacher Eugene Lovendusky, 26, who is gay and said he hopes to marry someday.

He then repeated a chant he had screamed during a protest at a fundraiser for President Barack Obama last night: "I am somebody. I deserve full equality."

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

"I have never been prouder to be a lifelong New Yorker than I am today with the passage of marriage equality," Cyndi Lauper said in a statement.

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 Friday's vote. "I am doing the right thing in voting to support marriage equality."

Gay couples in gallery wept during Saland's speech.

Sen. Mark Grisanti, a GOP freshman from Buffalo, also said he would vote for the bill. Grisanti said he could not deny anyone what he called basic rights.

The effects of the law 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, the Hamptons, the romantic Hudson Valley or that honeymoon hot spot of yore, Niagara Falls.

Governor Andrew Cuomo praised the vote on Friday, saying that "I am always proud to be a New Yorker. Tonight, I am especially proud to be a New Yorker."

New York, the nation's third most populous state, will join Connecticut, Iowa, Massachusetts, New Hampshire, Vermont and Washington, D.C., in allowing same-sex couples to wed.

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.

While court challenges in New York are all but certain, the state — unlike California — makes it difficult for the voters to repeal laws at the ballot box. Changing the law would require a constitutional convention, a long, drawn-out process.

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.

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 night before, President Barack 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.

White House spokesman Shin Inouye told The Huffington Post that "The President has long believed that gay and lesbian couples deserve the same rights and legal protections as straight couples." Inouye added that, "The states should determine for themselves how best to uphold the rights of their own citizens. The process in New York worked just as it should."