CONCORD, N.H. — An attempt to repeal New Hampshire’s same-sex marriage law failed on Wednesday in the House of Representatives, with members of the Republican-dominated chamber voting 211-116 to kill the bill.

Some opponents of repeal cited the state’s “Live Free or Die” motto, saying they were uncomfortable revoking any right that had already been granted. Others did not see the point of embracing the repeal when Gov. John Lynch, a Democrat, had vowed to veto it.

Had the repeal succeeded in both chambers, New Hampshire would have been the first state in which a legislature reversed itself on the issue of same-sex marriage. National gay-rights groups had invested heavily in fighting the bill, focusing on lawmakers with libertarian leanings.

With Republicans outnumbering Democrats by three to one in the House, which has approved a number of socially conservative bills this session, proponents of same-sex marriage feared early on that there was little chance of preserving the law.