Britain’s painful battle for Brexit had a stunning breakthrough Thursday — with a new divorce deal being tentatively approved by the European Union.

While the new plan needs to be formally approved and ratified by the bloc and UK’s Parliament, it was an unexpected development in the painful exit that has divided Britain as it appeared stuck in a never-ending deadlock.

“We are going to get Brexit done,” Britain’s prime minister Boris Johnson tweeted Thursday morning, adding the “#LeaveOct31st” for the deadline he had always insisted he would make.

“We’ve got a great new deal that takes back control — now Parliament should get Brexit done on Saturday so we can move on to other priorities,” he wrote.

EU commissioner Jean Claude Juncker seemed just as thrilled to announce the development just hours before a summit of all 28 EU national leaders.

“Where there is a will, there is a #deal – we have one!” he tweeted.

“It’s a fair and balanced agreement for the EU and the UK and it is testament to our commitment to find solutions.

“I recommend that #EUCO endorses this deal,” he said, referring to the European Conference.

The pound immediately hit a five-month high upon the U.S. dollar after the news broke.

Johnson had been mercilessly mocked and appeared set to be ousted as UK leader after his insistence that he could get a deal agreed by the end of this month — with the leader likening Brexit to climbing Mount Everest.

However, he is yet to make the summit — with Northern Ireland’s Democratic Unionist Party (DUP) still fighting back against the new deal.

“As things stand, we could not support what is being suggested on customs and consent issues,” DUP leader Arlene Foster and the party’s parliamentary chief Nigel Dodds said in a statement.

The so-called backstop — guaranteeing an open border between the U.K.’s Northern Ireland and EU member Ireland — has always been a stumbling block in negotiations.

“We will continue to work with the Government to try and get a sensible deal that works for Northern Ireland and protects the economic and constitutional integrity of the United Kingdom,” the statement added.

Johnson needs all the support he can get to push any deal past a deeply divided Parliament and will surely temper jubilation at the EU summit. The UK parliament already rejected a previous deal three times.

Johnson insisted he was confident the necessary legislation could be approved in time to leave on Oct. 31, his spokeswoman said.

“The public would expect if the deal is passed, for MPs to do everything they can to pass it on time and yes we are confident that we can do that,” she said.

With Post wires