CONCORD, N.H. (AP) — Gay rights advocates are declaring victory after New Hampshire's failed attempt at repealing its gay marriage law, saying it resounds in a region where opponents have concentrated efforts to reverse momentum.

The state House voted Wednesday to kill the measure, ending a push by its new Republican majority to rescind New Hampshire's 2-year-old law. Nevertheless, both sides are pledging to continue fighting into the fall elections.

"Today is a banner day for the freedom to marry," said Craig Stowell, co-chairman of Standing Up for New Hampshire Families. Stowell said the House, where Republicans hold a 189-seat advantage, was supposed to give conservatives their best shot at repeal.

"They blew it," he said. "This was supposed to be the most favorable legislative climate for repeal and they couldn't even get a majority."

The National Organization for Marriage has pledged to spend $250,000 to help lawmakers running for re-election who support repealing the law. On the other side, the New Hampshire Republicans of Freedom and Equality PAC is raising money to back Republicans who vote to retain it.

The Republican-backed bill called for repealing gay marriage in March 2013 and replacing it with a civil unions law that had been in place in 2008 and 2009. Same-sex marriages occurring before the repeal took effect would have remained valid, but future gay unions would have been civil unions.

The bill also would have allowed voters to weigh in on the issue through a nonbinding November ballot question.

If the House passed the repeal measure following its two hours of debate, it would have gone to the Senate; both houses are controlled by Republicans. Democratic Gov. John Lynch had promised to veto the bill in any case. The House vote was 211-116.

Tom Czapieo, 63, of Keene, watched the House debate from the gallery with his partner, Mike Bellrose, 61. Czapieo said he was surprised and thrilled by the vote, even though he and Bellerose have no immediate plans to marry.

"I was born this way," he said. "I should have the right to marry who I want."

An attempt to strip out a provision in the legislation calling for voters to weigh in on the issue in November in a nonbinding ballot question was rejected, helping to seal the bill's fate since some lawmakers objected that with a 400-member House, lawmakers should be able to make those decisions themselves.

Democrats enacted both the civil unions and gay marriage laws when they controlled the Legislature, and Lynch signed both. After Republicans took control of the House and Senate in 2010, repeal legislation was introduced but was held over until this year.

Same-sex marriage is legal in New York, Connecticut, Iowa, Massachusetts, New Hampshire, Vermont, Maryland, Washington state and Washington, D.C.

Voters have overturned gay marriage laws in California and Maine. A federal appeals court declared California's ban to be unconstitutional, and the matter could be appealed to the U.S. Supreme Court.

Associated Press writer Holly Ramer contributed to this report.