The House of Representatives, in a bipartisan vote of 306-91 Tuesday night, agreed to limit premium rate increases under the National Flood Insurance Program.

The bill must still pass the Senate or be reconciled with a version of flood insurance legislation that the chamber approved in January.

If the House version becomes law, with President Barack Obama’s signature, the measure would eliminate some of the changes made in a 2012 law that required the Federal Emergency Management Agency to raise rates to reflect flood risk. The law was intended to reduce losses to the insurance program, which is $24 billion in debt.

Conservative, libertarian, environmental and taxpayer watchdog groups opposed the bill, arguing that rates should be based on risk. Some said subsidies should be targeted only to people who couldn’t afford higher rates.

Rep. Jeb Hensarling, R-Texas, said during the debate that he would oppose the bill because the flood insurance program was “one reason America is going broke.”

“It forces 96 percent of Americans to subsidize the remaining 4 percent, regardless of income or need,” Hensarling said.

But Rep. Cedric Richmond, D-La., said the 2012 law had unintended consequences that needed to be fixed. Some people were finding that the higher premiums would “strip the dream of home ownership from right under them,” he said.

“This bill is both compassionate and fiscally responsible,” said Rep. Steven Palazzo, R-Miss.

The conservative Club For Growth warned that it opposed the measure and would use the vote in its scorecard of House members in this year’s midterm elections. The limited-government group’s political action committee supports conservative candidates.

A key part of the House bill would ensure that taxpayer subsidies for older homes continued when they were sold. It would strike the part of the law that ended subsidies when the homes were sold. That section of the law has raised many objections among homeowners along the Carolina coast, in Florida and elsewhere who were unable to sell homes because buyers bolted over the high rates.

The bill also would restore a grandfathering provision, allowing people who built to code in the past to avoid sharp rate increases when their property is remapped into a higher-risk flood zone. It also would provide funds to people who have already paid significant rate increases under the 2012 law.

The earlier Senate bill bill would delay the premium increases for four years. The Congressional Budget Office projected that the Senate bill would cost taxpayers about $2.1 billion over 10 years. House Republicans said that the CBO had advised them that their legislation would not worsen the program’s deficit because the measure would put a surcharge on all flood insurance policies. Significant differences between the bills would have to be resolved.

Steve Ellis, vice president of Taxpayers for Common Sense, a nonpartisan budget watchdog group, said in a call with reporters that the CBO didn’t take into account that in the future, as rates are held down and risk increases because of sea level rise and other factors, “the pressure on this program is going to be even greater and it’s going to have greater losses.”

Ellis and representatives of other groups have suggested that Congress could make adjustments to help people who couldn’t afford flood insurance.

Andrew Moylan, a senior fellow at the R Street Institute, a libertarian group, said his group’s goal was to move from a government-run flood insurance program to the private market. But until that happens, there should be a means test so that people who can’t afford the insurance get help and the wealthy pay their own way, he said.