CONCORD, N.H. — An effort to provide financial relief to New Hampshire’s dairy farmers strained by last year’s drought survived a challenge in the House on Thursday, with some opponents calling it a taxpayer funded bailout.

The drought forced many farmers to spend more on livestock feed, and some reduced their herds to save money. The state had 115 licensed cow-only dairies in October, down from 123 in January 2016.

“Many have slaughtered young calves along with milking cows, delayed repairs to farm tractors,” said bill supporter John O’Connor, a Republican from Derry. “Spouses have taken on second jobs to sustain them and have done all they can to get through the winter. The forage and hay they are purchasing comes from the Midwest or Saskatchewan, at an extremely high price.”

House members voted to adopt a committee recommendation that up to $2 million for dairy farmers be distributed through a formula. They also approved an amendment from Republican Rep. Neal Kurk, of Weare, allowing farmers to choose whether 2014 or 2015 was worse, and avoid “double-dipping” if they already receive crop insurance. Proposals to table the bill or replace it with a measure asking for donations for the farmers failed.

Kurk was part of a task force that worked on a plan to help the state’s dairy industry. He also chairs the House Finance Committee, which would normally take up the bill next. Kurk, instead, invoked a legislative rule allowing it to head back to the Senate, where it originated.