The US House of Representatives will vote later today on a motion of no confidence against the Republican speaker of the House of Representatives Kevin McCarthy testified by a hard-right Republican congressman, as well the infighting in the Republican Party (GOP) risk plunging Congress into chaos.

Republican lawmakers said the House would be called to vote later in the day on a motion to impeach McCarthy filed by Donald Trump friend Florida Rep. Matt Gates.

If the motion of no confidence is passed, it will be the first time in US history that a speaker of the House will be removed by the members themselves.

“I am optimistic. I’m betting on myself,” McCarthy told CNBC.

The move comes after a dramatic weekend in which a federal shutdown was averted at the last minute with Congress’ approval of a temporary deal on Saturday.

The deal appears to have left neither side satisfied with Joe Biden asking congressional Republicans to stop playing games with the threat of a shutdown, as the Democratic US president expressed his displeasure that the deal did not include approval of additional aid to Ukraine.

But the deal also sent shockwaves through Republican ranks, with Gates and other far-right Republicans outraged by McCarthy’s maneuvering of relying on Democratic votes to pass the bill to temporarily extend federal funding.

Gates accused McCarthy of making a “secret deal” with Biden on a potential Ukraine package amid budget deliberations. The GOP’s right wing strongly opposes releasing additional funds to Kiev, arguing that the money could be better spent dealing with the immigration crisis at the US-Mexico border.

The GOP has a slim majority in the House (221 seats to 212) and it would take just five Republican “defectors” to oust McCarthy if all Democrats vote against him.

Possibly, to keep his position, the Republican speaker of the House will need to rely on Democratic votes. The latter have not made it clear how they will vote and there are ongoing discussions within the Democrats about the position they will take.

Many of them say they view McCarthy as untrustworthy after he reneged on a deal he made with Biden on government spending and are outraged by his decision to green light an impeachment inquiry against the US president.

“I’m interested in hearing what every Democratic congressman has to say on the matter. And then we’ll come to a collective decision at the end,” House Democratic Leader Hakeem Jeffries told MSNBC. He said he spoke with McCarthy last night, but declined to reveal the content of the talks.

McCarthy told Republicans in a closed-door meeting that he would not try to cut a deal with Democrats, according to Republican spokesman Kevin Hearn.