The Russian invasion of Ukraine was a key factor that helped Rishi Sunak secure his Brexit deal, government insiders believe.
The last year has seen the UK government build bridges with capitals across Europe as the West banded together to oppose Russian aggression.
As old tensions over Brexit dissipated, the outbreak of war on the edge of Europe also concentrated the minds of EU leaders on what was important, opening up a new willingness to solve the problem of the Northern Ireland Protocol once and for all, sources say.
It was one of a number of elements that helped the prime minister deliver a shock Brexit deal that impressed even some headline Brexiteers in his own party.
Parts of the Tory party even believe the ‘Windsor Framework’, and the feeling they have got Brexit ‘done’, is the “secret weapon” that will help them win the next election despite Labour’s massive lead in the polls.
Another factor that smoothed the talks was the lack of a deadline.
Much had been made of the looming anniversary of the Good Friday Agreement.
President Biden was thought unlikely to want to visit the UK with the issues around the Northern Ireland Protocol still unresolved.
But all those involved took the attitude that the deal would get down when it got done.
That did not mean that there were not nervous moments, however.
Senior members of the government were spooked by noises coming out of a summit in Munich last week. At that stage they genuinely believed an agreement could be in peril.
The government had cleared part of its diary to seal the deal last week.
The President of the European Commission Ursula von der Leyen was even due to fly to the UK on Saturday. That was pulled, however, then hastily rearranged for Monday when it emerged a deal could be signed. Controversially, her planned meeting with the King was also reinstated, despite claims No 10 risked politicising the monarchy.
Sovereignty issues, based around the idea of getting consent for Northern Ireland politicians on future EU rules, proved to be the trickiest part of the talks in last few months.
UK government officials came up with the idea of the “Stormont brake”, believed to have been the big breakthrough which unlocked a final deal with Brussels.
But officials were still haggling over final details at 2am on Monday morning, thrashing out agreement on a long list of export declarations.
A source close to the negotiations said: “These things are gradual discussions that continue into the small hours in windowless buildings, with dubious sandwiches with needless amounts of egg involved.”
On the day the deal was done some of the officials involved went to bed at 3am.
The source added: “People who have been saying this deal was done two weeks ago should speak to our spouses. It’s not been sitting there finished.”