As Westminster lurches to the end of the worst week so far for the prime minister, there is only one clear winner evident as the fog of war subsides.

It’s not Sir Keir Starmer – Labour folk are fretting about their lack of impact at the moment.

Nor is it the 148 Tory rebels who want Boris Johnson gone, amongst whom there is an uneasy stasis amid disagreements on methods, timescales and alternative candidates for prime minister.

Politics Hub: PM told he has until autumn to save premiership

Instead the group increasingly back in the driving seat of British politics is the European Research Group: the few dozen Tory MPs at the heart of key turning points in the last decade – securing the Brexit referendum, slaying Theresa May, and pursuing a no compromise Brexit.

It’s this caucus which has seized the opportunity presented by the confidence vote.

They have used the political uncertainty it caused to increase their leverage, grabbing the steering wheel of state and putting the country on course for a huge and all-consuming row over Brexit and the Northern Ireland Protocol.

More on Boris Johnson

The ERG already know they’ve won the battle to get the government where they want them.

The fruits of the Brexiteers’ success will be visible to the rest of us on Monday with the publication of the Northern Ireland Protocol Bill – legislation unpicking elements of the Brexit settlement designed to prevent a hard border on the island of Ireland.

When it comes, it will be explosive and defining: this bill will be opposed by almost all opposition parties, a majority of the House of Lords, the countries of the European Union and the Commission, the Biden administration and a large chunk of the Tory rebels.

Please use Chrome browser for a more accessible video player


12:46

Raab: ‘Move forward’ after vote

Even the DUP leadership have, in private, been suggesting it needn’t necessarily go as far as Mr Johnson’s bill will do on Monday.

At points last month even Mr Johnson wasn’t minded to pursue a confrontation this big.

Downing Street was telling journalists that the prime minister regarded curbing the role of the European Court of Justice in the Protocol and ending tax harmony were less important than dealing with practical issues around the Irish Sea border which the EU has signalled a willingness to discuss.

But the ERG disagreed, and since the vote of confidence the PM has now been convinced that following their lead is existential to his survival.

Monday’s rebellion changed everything.

The closer than expected margin of victory – 211 to 148 – meant four in 10 Tory MPs do not trust this prime minister in office and want him out.

As a consequence, Mr Johnson’s priority this week was to work out who he can depend on in parliament in the coming weeks and months.

The group who emerged offering the hand of support was the ERG.

The ERG will now provide the “internal party majority”, said one source.

They will bulk him up at turbulent moments, and ensure there isn’t a majority of Tory MPs against him.

The condition of their support is that he pursues a tough as nails approach to stripping away large parts of the Brexit deal.

In 2019 Mr Johnson agreed that Northern Ireland would remain tethered to the European Union, subject to EU law with EU-mandated checks on goods going across the Irish sea.

Now the government wants to end this, and Monday’s bill will give the UK government powers to rid themselves of much of this.

“This issue is underpriced. But it would be worth a bet that the Northern Ireland Protocol is ultimately what finishes him off – not by-elections or changes in party rules to expedite his ousting,” said one member of the government.

Multiple sources have told Sky News that this was the week when the debate swung in the ERG’s favour.

Before Monday, an important minority of cabinet were in favour of taking a hard line.

Ms Truss, Dominic Raab, the deputy prime minister, Kwasi Kwarteng, the business secretary, and Suella Braverman, the attorney general, were leading the charge to legislate to end the role of the European Court of Justice in Northern Ireland.

“Initially the PM was quite nervous and not totally convinced that was the way to go because there would be too much fallout and too much pain,” one source said.

“But then there was no domestic political danger so he was prepared to be more circumspect.”

But they added that the position last month “would have left nobody happy”.

The DUP, which is looking for an excuse to go back into power-sharing in Stormont, would have had “nothing to go back with”; the ERG would have said it was “not good enough”.

Please use Chrome browser for a more accessible video player


1:23

‘Good Friday Agreement is first priority’

However, losing the support of four in 10 Tory MPs in Monday’s ballot meant Mr Johnson had to pick sides in this fight rather than continue his preferred approach of unconstructive ambiguity and vague threats.

“The vote swung it quite comfortably so it’s now in an ERG-friendly place.”

The row played out in two meetings of the Global Britain Strategy cabinet subcommittee this week.

Levelling Up Secretary Michael Gove raised questions about the legality of the move, while Chancellor Rishi Sunak raised the economic outcome of different scenarios.

The chancellor’s approach in particular did not impress the Brexit caucus, which could be important in a future leadership contest.

The leaking to Sky News of the legal advice by the government’s top lawyer Sir James Eadie helped poison what I’m told was already an uncomfortable discussion yet further.

But in the background the PM’s political advisor David Canzini was not shy in helping Mr Johnson to the conclusion that he could not fudge this issue: he must pick a side and the only reliable partners available – given the stance of so many of the cabinet – was to back a hardline approach.

Having Truss, Raab, Braverman, Kwarteng lining up with the ERG against him at this point was too dangerous.

Thus despite some misgivings, Mr Johnson agreed to a bill now set to satisfy the ERG.

There are huge political dangers.

Some think Mr Johnson does not have the long term strength to withstand international and domestic pressure to get the legislation on the statute book – but know he might not survive as PM if he fails and the ERG withdraw their support.

This bill could take 18 months to get through both Houses of Parliament if the Lords defeat it and the PM must force it through with the Parliament Act.

Meanwhile the likely international backlash – at a time of global price rises and war in Ukraine – will be intense and grow over time as Washington weighs up joining Brussels in its attempt to punish Britain for its stance.

And could 40 or more Tory MPs rebel on this given this week’s rebellion, thus depriving the PM of a majority for the legislation?

“The hubris of English nationalism is being seen plainly in NI and people are making their decisions,” said one Tory MP, indicating that there is a depth of feeling in parts of the party that matches the Brexiteers.

This could all end in flames.

Now that the Fixed Term Parliament Act has been abolished, Mr Johnson can turn votes on the legislation into a confidence vote, triggering a general election if he loses.

The stakes are about to get very high.