Something very unusual happened in the U.S. Senate today: a vote scheduled by the majority leader failed. The legislation would have repealed an Obama-era rule designed to prevent methane emissions from leaking out of drilling operations on public lands. Brought up under the Congressional Review Act, the resolution only needed 50 votes to pass the Senate, after already passing the House along party lines. But it failed 49-51.

Senate leaders like Mitch McConnell don’t typically advance votes on legislation unless they know it will pass. The Senate floor is almost never the scene for unexpected activity. So what happened?

It may have been Donald Trump’s firing of James Comey.

Three Republicans voted against repealing the methane rule, which was backed by the president. Lindsey Graham, R-S.C., and Susan Collins, R-Maine, had already announced their intention to vote no before the vote. But John McCain, R-Ariz., “unexpectedly” joined them.

Methane leaks on public lands are a significant problem in the Western “four-corner” states of Arizona, Colorado, Utah, and New Mexico, an area which is a known “hot spot” for methane emissions. McCain has shown mild support for environmental action in the past. And his friend Lindsey Graham voted no, and perhaps swayed him.

But here’s what McCain was doing right before the vote: On CNN, he condemned the Comey firing, showing an outsized regard for the former FBI director. “When you fire probably, arguably, the most respected person in America, you’d better have a very good explanation, and so far I haven’t seen that,” McCain said. He added that the firing would cause legislative problems. “We have a lot of issues and challenges and this just diverts a lot of that attention.”

McCain’s conduct during the Senate vote also raises red flags. In the C-SPAN video of the vote, McCain can be seen in heated discussion with John Cornyn, R-Texas, the number two man in the Senate leadership, along with John Barrasso, R-Wyo., and an unidentified senator with his back to the camera. After yelling at them for close to a minute, McCain goes over to the Senate clerks and gives a thumbs down to record his vote. He then storms out of the chamber, as Cornyn raises his arms in mild protest.

McCain has a reputation for being a little, shall we say, vindictive. It’s not out of the question at all that he would torpedo this vote, regardless of his ideological preferences, because of a fit of pique about the FBI director he admires getting unceremoniously dumped.

There’s a second possibility here: McConnell may have been counting on the votes of two moderate Democrats from energy production states: Joe Manchin, D-W.Va., and Heidi Heitkamp, D-N.D. They had reportedly considered repealing the methane rule. But in the end, they voted no.

Before the vote, Senate Minority Leader Chuck Schumer held an unusual all-caucus meeting in the morning to discuss their options in the wake of the Comey firing. Afterward, they did announce a slowdown of Senate business, denying unanimous consent for the holding of committee hearings this afternoon. Could Manchin and Heitkamp been encouraged to vote no in a show of unity against Trump and his agenda?

Whatever the reason, the vote against the methane repeal is quite a blow, because Congress faces a Thursday deadline to complete any resolutions under the Congressional Review Act. That means that the methane rule is likely safe from repeal through the congressional process, potentially preventing 180,000 tons of methane per year from rising into the atmosphere.

The episode shows how a bombshell event like the Comey firing can deeply disrupt the legislative agenda. If a methane rule cannot be repealed by the Republican majority, coming up with a version of repealing and replacing Obamacare could prove even tougher.

It’s unclear how long Democrats will keep up the grinding of Senate business to a halt. Virtually the entire caucus has called for a special prosecutor to examine the Trump campaign’s ties to Russia and the Russian role in meddling with the 2016 presidential election. McCain, for his part, has called for a select committee of Congress to investigate Russian interference.