Theresa May has managed what many thought was the impossible, she has placated the DUP, her cabinet and the European Union.

And now, with the country breathing a sigh of relief, those vital trade talks can finally begin.

When discussions collapsed at the beginning of the week it was touch and go as to whether the European Commission would recommend that phase two could begin in the new year.

There were some within the Conservative Party who thought it was to be Mrs May’s final error and she would have to go – but the prime minister, whatever you think of her, has to be given credit for never giving up.

The Irish border issue is not resolved though. Instead it has been put on hold in many respects with a clear commitment from all sides that there must be no hard border.

DUP leader Arlene Foster scuppered talks on Monday over concerns that Northern Ireland would be forced to have a different regulatory system than the UK – to facilitate an open border with the Republic. The fact that the prime minister is now adamant there will be no difference between Northern Ireland and the rest of the UK will have some Brexiteers worried that a clean break from Europe appears further away.

But there was “cautious optimism” after the dawn announcement in Brussels from most Leavers – and those who wanted to remain in the EU. Both sides will feel they have got something from the deal, but there is enough ambiguity to make them worried about what is still to come.

Colchester MP Will Quince thinks the agreement is a significant turning point for the UK that will result in a positive trade arrangement for both sides.

He said: “It is really great news. We are moving on to phase two which should be the easier part of the talks because we share a regulatory framework with Europe because we have been in it for 40 years. The hardest bit was negotiating our exit, that was the most controversial element.

“Of course there is going to be a lot of negotiation going forward about what our future relationship looks like. And that will be, at times, robust. But fundamentally we have got to the point where we have reached an agreement and that is great news.

“The prime minister has done a great job. The thing with Theresa is she believes in what she is doing. She has taken a lot of knocks in the last year or so and she doesn’t ever give up. This is a prime example. She said she was going to do it and she has done it.

“She said she was going to get us on to phase two, on to the trade talks and she has. I look forward to us striking a deal that is going to be both beneficial to us and the EU.”

There is no doubting that this is Mrs May’s finest moment since the car crash general election that almost toppled her premiership. She called the breakthrough “a hard-won agreement in all our interests”.

But her battle is far from over. European Council president Donald Tusk has set out guidelines for the next phase of talks, covering the transition to a post-Brexit relationship, which envisage the UK staying in the single market and customs union and observing all EU laws for around two years after the official withdrawal date in March 2019.

This will no doubt anger those within the prime minister’s own party who want a harder, cleaner Brexit.

Brexit poses an existential crisis for the EU. If the UK is seen to be getting a great deal, unrest – which already exists in many countries – will grow and those voices calling for more countries to quit will get louder.

Equally they will not want to unduly punish the UK. Because they need us and our trade just like we need theirs.

As for her rivals in the cabinet Mrs May remains vulnerable. Boris Johnson and Michael Gove will be watching on even more closely.

But for now at least the pair gave their public blessing to the deal, with the environment secretary describing it as a “significant personal political achievement for the prime minister” which would make more money available for the NHS. That remains to be seen.

Sources say the Brexit divorce bill will come to around £39 billion – and that could soothe some of the reservations the anti-EU wing of the Tory party have about regulatory alignment. It is significantly lower than the £50 billion suggested by previous leaks – another win for the PM.