The Senate on Wednesday failed to reverse an Obama-era regulation restricting harmful methane emissions that escape from oil and gas wells on federal land, a surprising win for environmentalists and Democrats and a blow to the fossil-fuel industry.

The vote was 51-49 in the Republican-led Senate with three GOP lawmakers — Maine's Susan Collins, Lindsey Graham of South Carolina and John McCain of Arizona — joining forces with the Democrats to block the efforts to overturn the rule.

President Barack Obama finalized a rule in November that would force energy companies to capture methane that's burned off or "flared" at drilling sites because it earns less money than oil.

Energy companies frequently "flare" or burn off vast supplies of methane — the primary component of natural gas — at drilling sites because it earns less money than oil. An estimated $330 million a year in natural gas is wasted through leaks or intentional releases — enough to power about 5 million homes a year.

Gas flaring is so prevalent in oil-rich North Dakota that night-time flaring activity on drilling sites is visible in NASA photos from space.

For months, Republicans have rammed through reversals of rules issued by Obama on gun rights, coal production, hunting and money for family planning clinics. They have used the obscure Congressional Review Act, which requires just a simple majority.

The latest target was the Interior Department rule on methane.

A coalition of groups with ties to the fossil-fuel industry and the conservative Koch Brothers had waged a public campaign to overturn the rule.

Republicans and industry groups call the rule an example of federal overreach under Obama and say it duplicates state rules in place throughout the West.

Democrats and environmental groups say the rule protects the public health and generates millions in revenue for state, local and tribal governments.