Merkel’s cautious assessment came one week before EU leaders meet in Brussels for what might be the last chance to seal a deal on Britain’s divorce from the European Union.

“There is progress,” Merkel said during a press conference with Dutch Prime Minister Mark Rutte in The Hague, but “everything is solved only when everything is solved.

“I hope for progress next week. We are pleased that there are intensive discussions, but the devil is in the detail,” the German leader added.

Merkel stressed that the other 27 EU countries were “very united” and that they “very, very” much trust the union’s chief negotiator, Michel Barnier.

Rutte said meanwhile that he was “cautiously optimistic” about a deal at the summit.

“I think we can be very cautiously optimistic next week that we can take steps there,” Rutte said. “A lot depends on the conversations in the coming days.”

The details at stake are mainly over how to avoid the return of border controls between EU member Ireland and the British province of Northern Ireland, amid fears they might put a 1998 peace deal in the north at risk.

Barnier said Wednesday that a deal was “within reach” but that Britain had to accept some customs controls between Northern Ireland and the rest of the UK, in order to protect the integrity of the EU’s single market.

The EU fears that without such controls, goods coming from post-Brexit Britain not subject to the union’s rules might slip into Ireland and then the rest of the bloc.

British Prime Minister Theresa May and the hardline Northern Irish unionist party that props up her government reject any encroachment on British sovereignty.

May is due in Brussels on October 17 for a last-ditch appeal to EU leaders, while frantic negotiations go on round the clock in Brussels.

The EU says that without “decisive progress” by next week’s summit they will not go ahead with a further meeting in November to finalise a Brexit deal.

That would see Britain crashing out of the EU in March 2019 with no customs or trade arrangements with the bloc, leading to potentially disastrous economic consequences.