THE Armageddon scenario of a crash-out Brexit in two weeks' time appears to have been narrowly avoided, but a battle now looms in Europe over how long a reprieve to give the UK.
MPs voted to seek an extension to the Brexit deadline from the EU, the length of which will depend on whether British prime minister Theresa May can get her deal through parliament in a third time lucky attempt next week.
Frantic talks between the Tory leader's allies the Democratic Unionist Party (DUP) and hard-line European Research Group (ERG) began last night, and are expected to last all weekend in a bid to see them support the deal when it is voted on again next week.
The DUP has signalled it could back the deal, which was seen as dead only a few days ago.
Revised legal advice is one avenue being pursued in a bid to get the deal over the line.
UK attorney general Geoffrey Cox is said to be redrafting the advice that ultimately killed Mrs May's vote on Tuesday to incorporate the Vienna Convention, which allows for the termination of a treaty if there is a "fundamental change of circumstances".
It is understood he is looking at whether the Irish backstop becoming permanent could be one of the grounds that would constitute a "fundamental change" and, if so, this will be reflected in the updated advice.
It is not clear, however, if the change to the advice would be enough, with some in the ERG suggesting it would not be enough to sway the deal's detractors among Brexiteers.
DUP leader Arlene Foster said her party is "working very hard" with the UK government so "we leave the EU with a deal".
She claimed the issue of the backstop had been overplayed and that Northern Ireland has a "very small market".
"We have always said if people have a mind to find those ways to deal with these situations, but unfortunately there has not been a willingness to find the way," she added.
"It is not a huge issue. People have made it into a huge issue. Let's be sensible, let's get a deal and let's make it work."
Meanwhile, the EU has off-ered to restart efforts this weekend to help Mrs May get the deal through, but also insists negotiations are done.
One suggestion being floated is offering further clarity on the role Stormont could have in negotiations in trade talks.
Mrs May's performance over the coming days will determine if she attends the EU Council next week with a deal in hand, or if she will be begging for an extension to allow the UK to get its house in order.
If her deal is agreed next Wednesday, she will seek an extension to give her until June 30 to allow Westminster to legislate for the deal to take effect.
However, if the withdrawal agreement is not passed, she will have to petition for a longer extension and the UK will need to participate in the European elections.
European leaders have expressed differing views on the idea of a long extension, but European Council president Donald Tusk has suggested a year or more.
Taoiseach Leo Varadkar said a longer extension would give the UK time to consider options "like participation in the customs union and single market".
"I think we need to be open to any request they make, listen attentively and be generous in our response," he said.
Ireland is expected to lobby other European leaders to help Mrs May secure an extension if she pleads for more time.
A two-year extension would mean the UK has to continue paying into the EU budget and would also throw up questions about the type of mandate MEPs would have in Europe.
Sources described the potential battle over an extension as a "robust debate" and a "bunfight" over what to give Mrs May if she seeks one.