British and EU officials were on the verge of a last-minute Brexit deal on Wednesday but Prime Minister Boris Johnson still has work to do at home to ensure parliament approves the plan.

“The basic foundations of this agreement are ready and theoretically we could accept a deal tomorrow,” said European Council President Donald Tusk, who will chair a summit of leaders, including Johnson, on Thursday and Friday.

However, Tusk said in comments broadcast by Polish broadcaster TVN 24 that “certain doubts have appeared from the British side”, apparently a reference to Johnson’s need to win over politicians who fear he may have conceded too much.

French President Emmanuel Macron said an agreement was being finalised and he hoped it could be approved by the summit on Thursday.

“I want to believe an agreement is being finalised and that we will be able to endorse it tomorrow,” Macron said at a news conference with German Chancellor Angela Merkel.

Merkel said she believed slightly more that a deal was possible, based on what she had heard in the recent days.

The EU leaders are likely to sign off a deal at their summit but their approval would be conditional on the British House of Commons backing it at a special sitting on Saturday, EU diplomats said.

If Johnson fails to nail down the terms of Britain’s exit from the European Union he will almost certainly have to seek an extension of the Oct. 31 departure deadline, more than three years after the country voted in a referendum to leave.

After another day of technical talks in Brussels, EU officials said an agreement had been beached on customs arrangements for Northern Ireland and on ‘level playing field’ provisions on labor and environment standards that the EU has insisted on to ensure fair competition.

But while differences over the divorce between the world’s fifth-largest economy and its biggest trading bloc had almost all been resolved, “overall backing from the British government” was still needed to seal an agreement, an EU diplomat said.

The main stumbling block remaining for Johnson appeared to be objections from a small Northern Ireland political party whose votes he must seek to get any deal through parliament.