Concord — A hotly contested bill that would create an expansive new school voucher program in New Hampshire passed the state House on Tuesday by a comfortable margin, 184-162.

The vote fell mostly along party lines, although more than a dozen Republicans voted against the measure while a handful of Democrats voted for it.

The bill, Senate Bill 193, would create a voucher-like system, with families who pull their children from public school able to claim upward of $3,500 in state money for an education savings account to spend on private education or home schooling.

Opponents argued that the bill siphons money from public schools and sends it to private schools that can discriminate against children with disabilities, requires participants to give up their right to special education services, puts oversight and accountability in the hands of a private organization that would administer the scholarships and violates the state constitution.

Supporters argued that it simply returns money to taxpayers who should decide which schools best fit the needs of their children and would have minimal impact on districts that lose students.

House Education Committee Chairman Rick Ladd, R-Haverhill, hailed passage of the voucher legislation, saying it “contains strong accountability requirements that will ensure the program is run smoothly and effectively.

“Any fiscal impact to school districts will be very minimal. Education is not one size fits all, and every child in New Hampshire deserves access to a quality education. This bill gives them that opportunity,” Ladd said in a statement.

The bill, which, according to one estimate, could cost the state upward of $31 million in new expenses over the next five years, next heads to the House finance committee.

The bill’s opponents, including the American Civil Liberties Union of New Hampshire, have argued that the bill violates the state’s constitution by sending public dollars to religious schools. The state Attorney General’s Office had for months warned legislators it had similar concerns — before abruptly reversing course just days before the vote.

Writing to House Chief of Staff Terry Pfaff on Dec. 28, Associate Attorney General Anne Edwards said the bill passed constitutional muster.

“As discussed with Attorney General (Gordon) MacDonald this morning, we believe that SB 193, with its proposed amendment 2018-2530h, is constitutional,” Edwards said in a two-sentence email. “There are a few areas of the proposed amendment that could be enhanced and we are ready to provide technical assistance to the House.”

The email was in stark contrast to what the Attorney General’s Office had repeatedly told lawmakers.

In one hearing, Edwards herself told legislators that not amending the bill to exclude religious schools would assure the legislation’s demise in the courts because of the state constitution’s strict prohibitions.

“We have to change our constitution if we want to have money — state, public money — going to religious schools,” she told the House Education Committee in April.

Gov. Chris Sununu, a Republican and staunch advocate of school choice, came out in support of the bill after it was amended to restrict eligibility.

To qualify, students must be low-income, be on a special education plan, have failed to gain admission to a charter school for lack of space, or failed to get an education tax-credit scholarship for lack of funding.

Still, about a third of New Hampshire students would qualify.

To assuage concerns about funding shortfalls in public schools, lawmakers included a provision to partially reimburse districts for lost dollars. Still, the unreimbursed amounts could add up.

If 40 students on free or reduced-price lunch use the program in Concord, a public education advocacy organization calculated, the school district would lose $213,000 in state aid — without getting any money back from the state.

A hearing in the House Finance Committee has been scheduled for April 4.

Material from the Associated Press was used in this report.