The Senate Judiciary Committee approved legislation on Thursday to protect special counsel Robert Mueller.

In a 14-7 vote, the panel approved the bipartisan proposal that deeply divided Republicans on the committee.

With every committee Democrat backing the legislation, only one Republican was needed to secure passage.

In the end, four Republicans voted for the bill: Sens. Thom Tillis (N.C.), Lindsey Graham (S.C.), Chuck Grassley (Iowa) and Jeff Flake (Ariz.).

Republican Sens. Orrin Hatch (Utah), Mike Lee (Utah), John Cornyn (Texas), Mike Crapo (Idaho), Ben Sasse (Neb.), John Kennedy (La.) and Ted Cruz (Texas) opposed it.

The vote marks the first time Congress has advanced legislation to formally protect Mueller from being fired by President Trump, who has railed against him in public and reportedly talked in private of dismissing him.

The bill, sponsored by Tillis and Graham (R-S.C.) with Sens. Cory Booker (D-N.J.) and Christopher Coons (D-Del.), would codify Department of Justice regulations that say only a senior Department of Justice official can fire Mueller or another special counsel.

It would give a special counsel an “expedited review” of their firing. If a court determines that it wasn’t for “good cause,” the special counsel would be reinstated.

The committee also added new reporting requirements into the bill, including notification when a special counsel is appointed or removed and requiring a report be given to Congress after an investigation wraps up; that report would detail the investigation’s findings and prosecution decisions.

Sen. Mike Lee (R-Utah) blasted the reporting requirements as “reckless” because it would require a special counsel to hand over the names of individuals whom they decided not to prosecute.

But Democrats praised Grassley for being willing to compromise on his amendment, marking a political 180 from as recently as Wednesday, when Democrats were concerned Grassley’s amendment could sink the bill.

Sen. Dick Durbin (D-Ill.) called the original amendment a “deal breaker,” while Sen. Dianne Feinstein (D-Calif.), the top Democrat on the panel, warned that she would vote against the bill “in its entirety.”

But the publicly released version of Grassley’s amendment didn’t include a provision that would have required a notification to Congress about changes to the “specific nature or scope” of Mueller’s investigation.

Feinstein praised Grassley on Thursday for making the “necessary compromises.”

“We have a piece of legislation that I believe will stand the test of time and will also stand the test of scrutiny,” she said.

The legislation now heads to the full Senate, where it faces entrenched opposition from key Republicans, including Majority Leader Mitch McConnell (Ky.).

“I’m the one who decides what we take to the floor, that’s my responsibility as the majority leader, and we will not be having this on the floor of the Senate,” McConnell told Fox News earlier this month.

The bill doesn’t have the 60 votes necessary to pass the Senate, and has even less of a chance to pass the more conservative House. It also would be unlikely to win the two-thirds support needed to override a presidential veto.

McConnell and most GOP senators say publicly that they believe Trump will ultimately decide not to fire Mueller, a former FBI director who is widely respected in Washington.

They also argue the legislation isn’t constitutional and, even if passed, would face a challenge in the courts.

“The special counsel must be permitted to complete his investigation. President Trump should not, and I believe will not, end the investigation,” Hatch wrote in a Wall Street Journal op-ed on Wednesday.

But Hatch, underscoring how most Republicans believe it would be a colossal mistake for Trump to fire Mueller, said the special counsel’s removal would “trigger a crisis, possibly even impeachment.”

Much of the debate during Thursday’s committee vote was between Republican senators on the panel.

The Judiciary Committee voted down an amendment from Cornyn, Hatch and Lee that would have gutted the special counsel bill and replaced it with a nonbinding sense of the Senate resolution on allowing Mueller to finish his investigation.

Sasse, Crapo and Kennedy joined Hatch, Lee and Cornyn to support the GOP amendment.

Grassley, Tillis, Graham, Flake and Cruz voted against the amendment.