In a rare victory for environmentalists under President Trump, the Senate rejected efforts to roll back an Obama-era rule limiting methane emissions from energy production sites on federal land.

The vote over the greenhouse gas was close — 49-51 — with Republican Sens. John McCain, Lindsey Graham and Susan Collins coming down against the resolution, which would have repealed the Bureau of Land Management's Methane Waste and Prevention Rule.

In a statement, McCain said he voted against the repeal because the effort made use of a legislative tool called the Congressional Review Act, which would have blocked similar regulations in the future.

"While I am concerned that the BLM rule may be onerous, passage of the resolution would have prevented the federal government, under any administration, from issuing a rule that is 'similar,' according to the plain reading of the Congressional Review Act," the Arizona senator said.

Graham previously told The Hill that he thought deploying the Congressional Review Act would be "too blunt an instrument in this case."

The methane measure passed the House, 221-191, in February.

Rhea Suh, the president of the Natural Resources Defense Council, called the Senate resolution an effort to "put polluters first and the rest of us at risk." The fact that it failed, she said in a statement, shows "a majority of the Republican-controlled Senate at last has come to its collective senses."

The Western Energy Alliance, a major oil and gas industry group, has described the methane regulation as an overreach of executive authority in a matter that is better left to the states and the Environmental Protection Agency.

The alliance vowed to continue pursuing legal action and working with the Department of the Interior to review and rescind the rule, a process initiated by the Trump administration but could take years. The White House is also taking aim at a slew of other Obama-era environmental regulations.

The greenhouse gas rule is intended to curb a practice called flaring, during which energy producers burn off natural gas that they can't process or sell. That process releases methane into the atmosphere.

NPR's Nathan Rott explained the rationale behind the regulation:

"The Obama administration sought to address the emissions with the BLM's methane rule. It requires oil and gas companies on federal or tribal lands to look for leaks and fix them. It limits allowable venting and flaring and directs producers to capture the natural gas. And it requires that oil and gas producers gradually update well sites with modern technology."The administration's reasons were twofold: For one, the rule would reduce waste of a natural resource being pulled from public lands."The second: Methane, the chief component of natural gas, is a potent greenhouse gas. It can warm the atmosphere at nearly 30 times the rate of carbon dioxide."

As Rott reported, oil and gas producers argue that the regulation is redundant and unnecessary because there are state laws that address the practice and because they say it's in their business interest not to burn off their own gas.

But critics say the notion of industry adequately limiting emissions without regulations doesn't bear out. They say it doesn't always make immediate economic sense for energy producers to swap out old, leaky equipment with newer, more environmentally friendly models, even if the lost gas costs them money.

That cost is significant, Rott notes:

"The Interior Department says that between 2009 and 2015, enough natural gas was lost on public lands to supply about 6.2 million households with energy for a year. In money terms, the Government Accountability Office says as much as $23 million of potential royalty revenue is lost annually."Copyright 2017 NPR. To see more, visit http://www.npr.org/.