Senate Republicans have failed in a vote to block an Obama administration rule limiting the acceptable amount of emissions from oil and natural gas drilling after three GOP Senators joined a united Democratic front to reject the effort.

The failure marks one the last chances for Senate Republicans to use the controversial Congressional Review Act to block Obama-era rules issued during the final months of the former president. It is also the first time that Senate Republicans rejected a resolution to pull back Obama regulations since President Donald Trump took the oath of office.

The rule in question was directed at the Bureau of Land Management and Republicans needed just 51 votes to eliminate it. There are 52 Republicans in the Senate.

“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 rule that is ‘similar,’ according to the plain reading of the Congressional Review Act,” Arizona Senator John McCain, who cast a surprise “no” vote, said.

He joined Republican Senators Lindsey Graham and Susan Collins in breaking from their party and saving the emissions rule.

The vote was a rare victory for environmentalists under the Trump White House. Democrats praised the denial of repeal.

Lisa Murray's climate change photography Show all 12 1 /12 Lisa Murray's climate change photography Lisa Murray's climate change photography Dinka cattle herders starting their migration in South Sudan Lisa Murray Lisa Murray's climate change photography A Dinka woman fetches water in South Sudan Lisa Murray Lisa Murray's climate change photography Veronica in South Sudan preparing tea outside her home, recently ravaged by heavy flooding Lisa Murray Lisa Murray's climate change photography Children playing in Vietnam. When it floods, transport to and from school is a major challenge Lisa Murray Lisa Murray's climate change photography Sugeng, a fish and crab farmer from Indonesia who suffers financially every time the area floods Lisa Murray Lisa Murray's climate change photography Tan, a vegetable farmer, learning new methods through Oxfam in Vietnam Lisa Murray Lisa Murray's climate change photography Maluk, a 19-year-old from Tonj South, South Sudan Lisa Murray Lisa Murray's climate change photography Normally this farmer in South Sudan would be harvesting sorghum, but rains are late so the hunger season continues Lisa Murray Lisa Murray's climate change photography Herders bringing home their cattle in Afar, Ethiopia Lisa Murray Lisa Murray's climate change photography Farmers harvesting chilli in Ethiopia Lisa Murray Lisa Murray's climate change photography A woman in Tigray, Ethiopia, scares birds away from her crops with a slingshot Lisa Murray Lisa Murray's climate change photography Irula tribe woman in Tamil Nadu Lisa Murray

“This is a good, solid rule, and it’s a commonsense rule, and I think it prevents waste just like it was laid out to do,” New Mexico Senator Tom Udall, a Democrat, said on the Senate floor. “We’re preventing waste, we’re doing job creation, and we’re acting on the part of public health.”