Media playback is unsupported on your device Media caption Johnson: This is a very good deal

Boris Johnson and EU leaders have hailed the deal they have struck to take the UK out of the bloc on 31 October in an "orderly" fashion.

The prime minister now faces a battle to get the deal through Parliament on Saturday, with the DUP opposing it.

DUP deputy leader Nigel Dodds accused Mr Johnson of being "too eager by far to get a deal at any cost".

European Council President Donald Tusk did not rule out an extension to the Brexit deadline if MPs rejected it.

EU Commission President Jean-Claude Juncker earlier said: "We have a deal so why should we have a prolongation."

But his Brussels colleagues have been more cautious, with Mr Tusk saying he would "consult" the leaders of EU member states about a possible extension if one was requested by the UK.

He said Boris Johnson's acceptance of customs checks at the point of entry into Northern Ireland, which the DUP objects to, had made a deal possible.

Mr Johnson has repeatedly insisted the UK will leave the EU on 31 October and he urged MPs to "come together" and "get this excellent deal over the line".

He added: "Now is the moment for us to get Brexit done and then together work on building our future partnership, which I think can be incredibly positive both for the UK and for the EU."

Image copyright PA Media

The EU and UK negotiating teams worked round-the-clock on the legal text of the deal, but it will still need the approval of both the UK and European parliaments.

In a statement, the Democratic Unionist Party, which the government relies on for support in key votes, said: "These proposals are not, in our view, beneficial to the economic well-being of Northern Ireland and they undermine the integrity of the Union."

The DUP deputy leader Nigel Dodds criticised Mr Johnson, telling BBC News: "If he'd held his nerve - and held out - he would, of course, have got better concessions which kept the integrity, both economic and constitutional, of the UK."

He said he expected a "massive vote" against Mr Johnson's deal on Saturday in the House of Commons - and the DUP expected to "play a crucial role" in amending the legislation.

Can Boris Johnson win the vote?

The winning post for votes in the House of Commons is 320 if everyone turns up - seven Sinn Fein MPs don't sit and the Speaker and three deputies don't vote.

There are currently 287 voting Conservative MPs. The prime minister needs to limit any rebellion among them.

Then, if the DUP won't support his deal, he'll need the backing of 23 former Conservative MPs who are currently independents. Most will probably support the deal, but not all.

That's still not quite enough, though, so the PM will also need the backing of some Labour MPs and ex-Labour independents. In March, when MPs voted on Theresa May's deal for the third time, five Labour MPs backed it, plus two ex-Labour independents.

This time it's likely to be a bit higher than that because several MPs have said they would now back a deal.

All this still leaves the vote very close. And it's possible some MPs could abstain, making it even harder to predict the outcome.

What is in the deal?

Most of the deal is the same as the one agreed by Theresa May last year - the main change is the Northern Ireland proposal.

The UK will continue to abide by EU rules until the end of 2020, and possibly longer, to allow businesses to adjust

The UK will still pay an estimated £33bn "divorce bill"

The rights of EU citizens living in the UK, and UK citizens in the EU, will be guaranteed

What's changed?

Northern Ireland will be aligned to the EU single market

The controversial "backstop" - that critics feared could have kept the UK in a customs union with the EU indefinitely - has been removed

Northern Ireland will instead remain a part of the UK's customs territory, so it will be included in any future trade deals struck by the government after Brexit

But Northern Ireland will also remain an entry point into the EU's customs zone. The UK will not apply tariffs to products entering Northern Ireland as long as they are not destined for onward transportation across the border

A joint EU/UK committee will decide which goods are at risk of entering the single market and the UK will collect EU tariffs on them on behalf of the EU

The Northern Ireland Assembly - which has been suspended since January 2017 - will get a vote every four years on whether to continue with the new trading arrangements

The decision would be based on a simple majority, rather than requiring a majority of both unionists and nationalists to support the rules in order for them to pass

Media playback is unsupported on your device Media caption Barnier: This text should provide certainty

The DUP's objections

In a statement, the Democratic Unionists said Northern Ireland's main East-West trade route would still be subject to EU customs rules, "notwithstanding that Northern Ireland will remain part of the UK customs territory".

"All goods would be subject to a customs check regime regardless of their final destination," the statement added, and the plan for a joint EU/UK committee would give the EU a "veto" on which goods would be exempt from tariffs or not.

"This is not acceptable within the internal borders of the United Kingdom," the DUP said.

They expressed concerns Northern Ireland consumers would face increased costs and less choice, and Northern Ireland would also be subject to different VAT arrangements to the rest of the UK.

"Some progress" had been made on democratic consent for the deal, it went on, but the idea of giving the Assembly a vote on the new arrangements that could be won by a "simple majority" violated the Good Friday Agreement, which demands the backing of both unionists and nationalists.

While Boris Johnson may have a deal in Brussels, he absolutely does not have a deal in Westminster.

The DUP isn't prepared to back this package because it does not give it a veto over the new customs arrangement, which it fears could threaten Northern Ireland's position in the United Kingdom.

Team Johnson hopes that, by presenting this as a choice between Mr Johnson's deal and no-deal, the DUP will buckle.

But the DUP doesn't blink easily, and if it doesn't, the signs are Mr Johnson could be defeated on Saturday, when the party's 10 votes could be critical.

That could trigger the Benn Act, forcing a lengthy delay, and could encourage some opposition MP to trigger a motion of no confidence, paving the way for a general election.

It's going to be a titanic tussle on Saturday.

Labour leader Jeremy Corbyn said the deal sounded "even worse" than the one negotiated by the PM's predecessor, Theresa May, and "should be rejected" by MPs.

MPs have voted to hold an extra sitting in the Commons on Saturday to discuss the next steps.

Cabinet Office minister Michael Gove said the government would hold a vote on the deal and was not "not contemplating defeat".

But, he added, if the plan did not get the backing of MPs, the alternative was leaving without a deal.

EU chief negotiator Michel Barnier said he and Mr Juncker had been told by the PM that "he has faith in his ability to convince the majority he needs in the House of Commons".

Brexit Party leader Nigel Farage called for the deal to be rejected by Parliament, saying it would mean "we will not be making our own laws in our own country".

Liberal Democrat leader Jo Swinson said: "The next few days will set the direction of our country for generations, and I am more determined than ever to stop Brexit."

MPs passed a law in September that requires the PM to request an extension on 19 October if Parliament has not agreed a deal or backed leaving without a deal by that date.

Do you have any questions about the proposed Brexit deal?

In some cases your question will be published, displaying your name and location as you provide it, unless you state otherwise. Your contact details will never be published. Please ensure you have read the terms and conditions.

Use this form to ask your question: