The Associated Press

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

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 efforts to overturn the rule.

President 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 previously obscure Congressional Review Act, which requires just a simple majority in both chambers to overturn rules imposed recently imposed by the executive branch.

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, which they said would decrease energy production on federal lands, raise energy costs and eliminate jobs.

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 countered that the rule protects the public health and generates millions of dollars in revenue for state, local and tribal governments.

Gleeful Democrats hailed the vote as a breakthrough in the GOP-controlled Congress.

“Today’s vote is a win for American taxpayers, a win for public health and a win for our climate,” said Sen. Ed Markey, D-Mass. “Rejecting this Republican attempt to allow oil and gas companies to continue wasting natural gas owned by the American people will ensure that American taxpayers will not get burned. And it will ensure we don’t lose control of managing methane emissions on public lands that contribute to climate change.”

The American Petroleum Institute, the oil and gas industry’s top lobbying group, called the Senate vote disappointing, but said in a statement it looks forward to working with the Trump administration on policies to boost energy production.

Jamie Williams, president of the Wilderness Society, an environmental group that had pushed to defend the Obama rule, said the Senate vote was the result of grass-roots efforts by voters across the country.

“In recent months, thousands of Americans asked the Senate to stand up for clean air and against the oil lobby, and their efforts were successful today,” Williams said.