WASHINGTON — Texas Sens. John Cornyn and Ted Cruz were among Republicans who opposed a move Thursday to protect special counsel Robert Mueller from being fired. The bill cleared the Judiciary Committee 14-7, with four Republicans siding with Democrats who want to block President Donald Trump from derailing the investigation.

The Texans’ votes weren’t a surprise. Cornyn has repeatedly said that such legislation isn’t necessary because he doesn’t believe Trump would fire Mueller, calling such a move a "bad mistake" that could cause “all sorts of unintended consequences."

Cruz expressed concerns about an overreaching and potentially partisan special counsel investigation.

The measure has little chance of becoming law.

Senate Majority Leader Mitch McConnell has said he won't bring it to a floor vote. The four Republicans who voted for the bill were the committee’s chairman, Chuck Grassley of Iowa, and Thom Tillis of North Carolina, Lindsey Graham of South Carolina and Jeff Flake of Arizona.

Some lawmakers began discussing the need for legislation protecting Mueller earlier this month after an FBI raid on the home and office of Trump’s lawyer, Michael Cohen. The president tweeted his outrage after the raid, causing lawmakers from both parties to warn against the firing of the special counsel.

Cohen told a federal court this week that he intends to invoke his Fifth Amendment right against self-incrimination, fueling speculation that he faces serious legal peril and could turn on Trump to protect himself. Trump acknowledged Thursday in an interview on the show Fox and Friends that Cohen handled a nondisclosure deal on his behalf with Stormy Daniels, the adult movie actress who says Trump's lawyer paid her $130,000 to keep quiet about a sexual encounter.

Cornyn, the No. 2 Senate Republican, called the committee’s vote a “futile act” because it’s obvious that the measure won’t come to the Senate floor, pass in the House or be signed into law by Trump.

“We all believe that Director Mueller should be allowed to complete his job and that it would be a mistake for the president to terminate him without good cause,” Cornyn told Texas reporters Thursday.

Cruz, who worked under Mueller at the Justice Department, has expressed concerns that the special counsel's probe “may be a partisan fishing exercise.” On Thursday, he added that he's "deeply concerned about the partisan composition of the lawyers" in Mueller's office.

But Cruz has not joined Cornyn and other Republicans in warning Trump against firing Mueller.

"That's ultimately a decision for the president to make," Cruz said Thursday afternoon.

Cornyn, Cruz and other Senate leaders also argue that a law protecting the special counsel could be unconstitutional.

“It’s unconstitutional under the separation of powers doctrine for Congress to try to limit the power of the executive who has sole authority when it comes to criminal investigation and prosecutions,” Cornyn said.

Before the final vote, Cornyn authored an amendment that would have stripped out any mechanism for Mueller to contest a firing, instead turning it into a "sense of the Senate resolution" warning Trump not to fire him.

The amendment failed. Cruz was among those voting it down.

Delaware Sen. Chris Coons co-authored the measure with a Democratic colleague, New Jersey Sen. Cory Booker, and two Republicans — Tillis and Graham.

“We worked well with Chairman Grassley and Ranking Member Feinstein to refine and improve the bill and make today’s vote possible,” he said.

California Sen. Dianne Feinstein, the ranking member of the committee, praised the passage of the bill.

“BREAKING: Good news! The Senate Judiciary Committee has voted to send the Special Counsel Independence and Integrity Act to the full Senate,” Feinstein tweeted after the vote. “This an important step to protect the special counsel from being fired.”

Washington correspondents Tom Benning and Katie Leslie contributed to this report.