Gay groups looking to legalize gay marriage in New York cheered the Democratic primary loss on Tuesday of state Senator Bill Stachowski.

Gay marriage proponents took on the task of ousting senators who voted last year against a bill that would have legalized gay marriage in the state. Passage of the bill in the Senate remained its final hurdle to becoming law.

Among the targets were Stachowski of Buffalo, Shirley L. Huntley of Queens and Ruben Diaz Sr. of the Bronx.

Primary voters overwhelmingly picked Tim Kennedy, a pro-gay marriage candidate, over incumbent Stachowski.

“Tonight voters sent a clear message to lawmakers everywhere that taking a stand for equality is the right thing to do,” Joe Solmonese, president of the Human Rights Campaign (HRC), the nation's largest gay advocate, said in a statement.

The group Fight Back New York had attracted major Hollywood talent, including Sex and The City 2 star Cynthia Nixon and Jesse Tyler Ferguson, star of ABC's Modern Family, to its campaign against the anti-gay senators.

Stachowski is the second win for the group, which first called for the removal of Hiram Monserrate in a special election held in March.

“Starting tomorrow, we shift our focus to the November [election], and anti-equality incumbents are paying very close attention to where we focus our energies next,” group said on its website.

The group will most likely continue to pursue Huntley and Diaz, both of whom advanced to the general election. But which of the other 34 senators who voted against the measure they'll set their sights on remains to be seen.

This week, HRC launched a new campaign starring, among others, Kenneth Cole and Julianne Moore urging New Yorkers to support passage of a gay marriage law.