Boris Johnson appears to be on the brink of reaching a Brexit deal after making major concessions to EU demands over the Irish border.

A draft text of the agreement could now be published on Wednesday if Downing Street gives the final green light, according to senior EU and British sources.

It is understood that the negotiating teams have agreed in principle that there will be a customs border down the Irish Sea. A similar arrangement was rejected by Theresa May as a deal that no British prime minister could accept.

Johnson will still have to win over parliament – including the Democratic Unionist party (DUP) and the hardline Tory Brexiters of the European Research Group (ERG) – on the basis that, under the deal, Northern Ireland will still legally be within the UK’s customs territory.

One Eurosceptic source close to both camps indicated that such an arrangement would be “extremely difficult for the DUP to swallow”, but neither the DUP nor ERG publicly made any criticism of Johnson’s efforts.

The prime minister will brief his cabinet on the situation at 4pm on Wednesday before addressing a scheduled meeting of the 1922 Committee in the evening.

Quick guide Why is the Irish border a stumbling block for Brexit? Show Hide Counties and customs Inside the EU, both Ireland and Northern Ireland are part of the single market and customs union so share the same regulations and standards, allowing a soft or invisible border between the two.

Britain’s exit from the EU – taking Northern Ireland with it – risks a return to a hard or policed border. The only way to avoid this post-Brexit is for regulations on both sides to remain more or less the same in key areas including food, animal welfare, medicines and product safety. The 'backstop' in Theresa May's Withdrawal Agreement was intended to address this - stating that if no future trade agreement could be reached between the EU and the UK, then rules and regulations would stay as they are. This has been rejected by Brexit supporters as a 'trap' to keep the UK in the EU's customs union, which would prevent the UK striking its own independent trade deals. There are an estimated 72m road vehicle crossings a year between Northern Ireland and the Republic of Ireland, and about 14% of those crossings are consignments of goods, some of which may cross the border several times before they reach a consumer. Brexit supporters say this can be managed by doing checks on goods away from the border, but critics say it will be difficult to police this without any physical infrastructure like border posts or cameras, which could raise tensions in the divided communities of Ireland.

Interactive: A typical hour in the life of the Irish border Photograph: Design Pics Inc/Design Pics RF

Steve Baker, the leader of the ERG, emerged from a meeting in No 10 saying he was “optimistic that it is possible to reach a tolerable deal that I am able to vote for” and later told fellow Eurosceptics to “trust in” the prime minister.

Arlene Foster, the DUP leader, was due to see Johnson again on Tuesday night, and told reporters ahead of the meeting that she would “do what’s best for the union”.

In a statement released to the BBC after a 90 minute meeting at No 10 on Tuesday night, the DUP said they could not give detailed commentary amid ongoing negotiations but “it would be fair to indicate gaps remain and further work is required”.

Under his proposals, the prime minister would be able to boast that the UK “whole and entire” had left the European Union. “Northern Ireland would de jure be in the UK’s customs territory but de facto in the European Union’s,” one diplomatic source said of the tentative agreement.

Sources in Brussels said they were confident that the commission and UK negotiating team would land the deal overnight. But as negotiations continue, there was nervousness in Paris and Berlin about the rush to find a deal for the EU27 leaders to sign off at Thursday’s European council summit in Brussels.

Speaking in Paris, a senior French official advised “extreme prudence” about the chances of a deal being struck that would satisfy the EU’s capitals.

“It’s not the Irish who will make the deal,” the official said. “Yes, there are better atmospherics, but what matters is the content, and we have seen nothing yet. Whatever it is, we will want to look at it in very serious detail.”

German government officials said reaching a deal this week was an ambitious target and that agreeing on the technical issues could require another two months of talks, unless the UK made significant enough concessions.

The Irish taoiseach, Leo Varadkar, sought to reassure EU capitals who were fearful a deal was being rushed. “I would never ask the commission or the member states to compromise the single market, because our jobs and our economy and our security depends on that too,” he said.

“We’re going to have to see how the next few days develop. If we can get to an agreement, on Thursday or Friday, and if the House of Commons is able to vote in favour of an indicative vote in favour of that agreement on Saturday, it may not be necessary to even consider an extension.”

Varadkar expressed cautious optimism, telling reporters in Ireland that “initial indications are that we are making progress, that the negotiations are moving in the right direction”.

Is a deal in sight? - Brexit Means ... podcast Read more

Foster warned that Northern Ireland must remain in the UK customs union, but did not pour cold water on the deal on the table.

“We are in a negotiation. It is right to give negotiators time and space to do all this. It’s all speculation. People have to get real. We’re not under pressure at all. We’re not the ones under pressure,” she told RTÉ News.

Asked later whether she would concede a customs border in the Irish Sea, she told BBC Newsline: “No. We must remain within the UK’s customs union. It is a principle we have ... and that will forever be there. We have to be integrally within the UK.”

Earlier on Tuesday, Michel Barnier had set Johnson a midnight deadline to concede to EU demands and agree to a customs border in the Irish Sea or be left with nothing to take to the Commons.

The EU’s chief negotiator advised the EU27 would announce on Wednesday afternoon whether negotiations on an agreement would have to continue into next week.

Barnier said the starting point for a deal would be the Northern Ireland-only backstop, keeping the province in the EU’s single market for goods and creating a customs border down the Irish Sea.

Q&A What is a Northern Ireland-only backstop? Show Hide The British government’s version of Brexit involves the UK ultimately leaving the single market and customs union, requiring the return of a range of checks on goods crossing the border between Northern Ireland and the Republic of Ireland. The “backstop” is intended as a standstill placeholder to ensure such checks do not have to be imposed between Brexit happening with a deal, and the start of a new free trade agreement yet to be negotiated between the UK and the EU. Theresa May's withdrawal agreement proposed keeping the whole of the UK in a shared customs territory with the EU during this period. An alternative idea involves only Northern Ireland staying in the EU’s customs territory. That would place a customs border in the Irish Sea. May described it as a threat to the constitutional integrity of the UK, but the new prime minister, Boris Johnson, has opened the current talks by proposing an all-Ireland agri-food zone. The suggestion is that he will seek to quietly build on that with further NI-only arrangements. Given an NI-only backstop was an EU proposal in the first place, the U-turn would be warmly welcomed in Brussels, although attempts to give the Northern Ireland assembly a veto on its continuation would not be acceptable, and the DUP would be unlikely to support the prime minister in such a move in parliament. If there is a no-deal Brexit, then there is no backstop. Daniel Boffey

After the meeting, Belgium’s deputy prime minister, Didier Reynders, said: “If we have an agreement tonight, it will be possible to go to the [European] council and then again to the British parliament. But it’s not easy. We have some red lines, they are well known by all the partners. I’m hoping it will be possible today to make some progress.”

In a phone call with Johnson on Tuesday, the French president, Emmanuel Macron, acknowledged the momentum towards reaching a deal, but raised the possible need for a “technical” Brexit extension beyond 31 October to allow talks to bear fruit.

The bloc has insisted the EU27 leaders will not negotiate when they meet. “The European council will be a political moment to tell the story, not to make detailed technical negotiations,” said one French official. “It cannot be a catch-up. We do not do things urgently.”

The thorny issue of how to avoid a hard border on the island of Ireland has dogged the negotiations. The UK has accepted that Northern Ireland will remain in the EU’s single market for goods, although it is seeking to find a way to time-limit the arrangement through a consent mechanism for the assembly in Stormont.

Barnier told ministers the UK had dropped the original Stormont lock idea tabled by the prime minister on 1 October, which would have, in effect, given the DUP a veto on arrangements for avoiding a hard border coming into force and staying in force. Under the new thinking, a majority of both nationalists and unionists would need to give consent at a point later in time.

Downing Street last week accepted there would not be a customs border on the island of Ireland. The government has been seeking a way to avoid one in the Irish Sea on the basis that it would represent an economic dislocation of the country.

But the EU rejected the UK’s proposal of a dual customs system at Northern Ireland’s ports and airports that would involve tracking goods entering from Great Britain and applying differential treatment depending on their final destination.

Barnier has instead pushed the UK to accept a model closer to a Northern Ireland-only backstop.

Under the deal being negotiated, Northern Ireland would not be part of the EU’s customs territory, but the bloc’s full customs code would have to be enforced in the Irish Sea.

The Brexit secretary, Stephen Barclay, who was also in Luxembourg and briefly met Barnier on Tuesday morning, had earlier insisted a deal was “still very possible” when speaking to reporters. “The talks are ongoing,” he said. “We need to give them space to proceed but detailed conversations are under way.”

Play Video Michel Barnier says Brexit deal will be difficult but is 'still possible this week' – video

If Johnson does emerge with a deal, he would probably try to pass it through parliament very quickly on a historic Saturday sitting. Jacob Rees-Mogg, the leader of the House of Commons and an ally of Johnson, told LBC he believed the numbers were there for a deal. But the prime minister will need almost all Conservatives, most of the former Tories from whom he withdrew the whip, and either the DUP or a bloc of about a dozen Labour MPs to pass the deal through the Commons.