British and European negotiators resumed intense negotiations on a draft Brexit deal on Wednesday after late-night talks brought them closer but failed to confirm an elusive breakthrough.

News that Britain has softened its stance on the customs status of Northern Ireland to clinch an accord at this week’s European summit had raised hopes that a chaotic “no-deal Brexit” could be avoided.

But a marathon late-night negotiating session in the EU’s Brussels headquarters brought them to the eve of the meeting with still some distance to go to agree on the wording of a treaty to govern the terms of Britain’s planned October 31 departure from the bloc.

“The teams worked into the night and continue to make progress. The teams will meet again this morning,” a UK official said, describing the talks as “constructive”.

A senior European diplomat said that the negotiators had begun to transcribe the British offer into a legal text that could eventually go before the European Council summit on Thursday.

But some important differences remain, the diplomat cautioned, while a European official speaking on condition of anonymity played down hopes that any text would be finalised on Wednesday.

Even if a text is prepared for the leaders this week – or if, as many observers in Brussels expect, an extraordinary summit is called later in the month – any deal would have to be approved by a sceptical British Parliament, which holds a special session on Saturday.

By agreeing to a form of customs boundary in the Irish Sea, Britain could allow Northern Ireland to remain under EU rules, prevent a return to a hard land border and salvage a negotiated withdrawal.

But British Prime Minister Boris Johnson may struggle to convince hardline Conservative eurosceptic members of Parliament and his allies from Northern Ireland’s Democratic Unionist Party (DUP) to accept this concession.

Nevertheless, EU negotiator Michel Barnier and British Brexit minister Stephen Barclay judged that a deal was close enough to justify officials working into the early hours of Wednesday.

Barnier had said a text must be on the table by Wednesday if member state governments are to have a chance to consider it before the summit because the 28 national leaders insist they will not debate the details of the agreement at their meeting.

But if, as now seems likely, the Wednesday deadline is missed, officials said talks could instead resume next week and a special summit be called just in time for Johnson to fulfil his pledge to lead Britain out of the bloc.

European leaders warn they will not let Britain use Northern Ireland as a back door to the single market and Barnier said that “it is high time to turn good intentions into legal text”.

German Chancellor Angela Merkel outlined why EU officials are driving a hard bargain and hoping Britain will commit to a “level playing field” in post-Brexit trade and commerce.

“One thing is clear, Britain will develop into another competitor on the doorstep of Europe,” Merkel told German industrialists on Tuesday.

“And therefore the EU will be challenged to become more competitive and to assume geopolitical responsibility.”

“The last moment is always a bit later than you think,” one German government official said suggesting Brexit would have to be postponed beyond the end of the month if talks are to reach a successful conclusion.

More than three years after Britain’s 2016 referendum vote to leave the European bloc, talks remain stuck on how to avoid customs checks on the border between British-ruled Northern Ireland and EU-member Ireland.

The EU has reservations about London’s proposed customs arrangements and the role for Northern Ireland’s Stormont assembly in giving consent to the plans.

DUP leader Arlene Foster told the BBC that she wanted to support a deal, but would not do so if she felt it divided Northern Ireland from the rest of the UK and added that without her party’s support “everybody knows” it would not pass in parliament.

If no deal is reached by Saturday, Johnson will fall foul of a British law which demands he ask the EU to postpone Brexit for the third time rather than risk a potentially disastrous “no-deal” departure.