By the skin of her teeth, at the 11th hour, she did it. Just about.

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.

South Norfolk MP Richard Bacon said: 'There appears to be a general consensus among my Brexit-supporting colleagues that we are in a much better place now than we were a week ago.

'I am pleased that it says in the document that 'nothing is agreed until everything is agreed' because it is important that we reserve our position until everything is finalised.

'I think we are making progress and we are moving on to the next stage. Getting on to the trade talks is important but I think it is overstated. The phrase 'crashing out of the EU' has been manufactured to create the view there would be no deal. In fact what we would move to would be a global trade deal that already exists called the WTO.

'But this is a satisfactory position to be in. I have cautious optimism going forward.'

Norwich South MP Clive Lewis, an ardent Remainer, said he believed the document suggested there would be UK-wide alignment.

'It appears the UK will continue to be aligned with Europe,' he said. 'I don't see how that cannot have annoyed some people. It seems to pacify the DUP it has been stated that the whole of the UK will stay closer to Europe to avoid a hard border.

'I don't know how she has got that passed the cabinet. But the DUP's brinkmanship appears to have paid off and Michael Gove and Boris Johnson have had to concede.

'I would welcome regulatory alignment. It is an important first step. But it opens up other questions – this doesn't sound like taking back control to me. The whole point of leaving was to save money and give it to the NHS. So what kind of Brexit is this? What is the point? Why don't we help business further by committing to the custom union and single market?

'The 'no deal is better than a bad deal' rhetoric was clearly all bluster. That is dead now.'

Sir Henry Bellingham, MP for North West Norfolk, added: 'There is so much at stake and a real determination on the part of the EU to get this done – they need our money. So I was expecting it but I am delighted. Theresa May has had a tough time. She has been attacked form all sides. But she has got it done. Good on her.'

But danger both for Mrs May and the country remains. This deal marks not the end but the beginning. The second phase will prove even harder than the first.

Both London and Brussels can see the benefits of striking a successful trade deal but the EU will be keen to make sure any agreement is not as good as actually being a member of the club.

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 already calling for more countries to quit will get louder.

Equally they will not want to unduly punish the UK. Because, as Sir Henry rightly states, they need us and our trade just like we need theirs.

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