By Valerie Volcovici

WASHINGTON (Reuters) - In a blow to administration efforts to free the oil and gas industry from Obama-era environmental rules, a Senate resolution to revoke a rule to limit leaks and flaring of methane from oil and gas production on federal lands fell short of votes 49-51 on Wednesday.

The surprise vote outcome came after Republican leaders scrambled for weeks to secure the 51 votes necessary to pass the Congressional Review Act resolution, which would revoke the rule and prevent any similar regulations from being introduced.

Getting the Trump administration to repeal the Interior Department's Bureau of Land Management methane rule had been a top priority of the oil and gas industry, but not all Republicans supported the measure because it would make it difficult to regulate methane waste in the future.

Republican Senator John McCain of Arizona made a surprise vote against the resolution, joining fellow Republicans Lindsey Graham of South Carolina and Susan Collins of Maine in opposition.

The rule, finalized by President Barack Obama in his lacks weeks in office, updated 30-year-old regulations that govern flaring, venting and natural gas leaks from oil and gas production. His administration said the rule could avoid wasting up to 41 billion cubic feet (BCF) of natural gas per year.

Industry groups such as the American Petroleum Institute had argued that the rule was unnecessary because companies have made strides in reducing methane leaks from their operations.