Following an agreement between the EU and UK on a Brexit text that deals with the Irish border, here are some of the questions that are being asked:

How did we get here?

It has been a long road since the referendum vote to leave the EU on 23 June 2016.

A two-year period of negotiation was formally triggered by the UK's Article 50 letter on 29 March 2017 and actual talks were delayed further by the snap general election of 8 June.

A Joint Report was agreed by British Prime Minister Theresa May and European Commission president Jean-Claude Juncker on 8 December, but left some of the most contentious issues to be thrashed out.

What is in the Withdrawal Agreement?

The agreement covers arrangements for disentangling the UK from the EU after more than 40 years of membership.

Key issues are the future rights of British expats living on the continent and Europeans in the UK; the settlement of the UK's financial liabilities, estimated at up to £39bn; and the status of the border on the island of Ireland.

What has held things up?

The main obstacle to an agreement has been the question of the Irish border, which will be the UK's only land frontier with the remaining EU after Brexit.

Neither side wants a "hard" border with physical checkpoints and customs inspections, which they fear could undermine the Northern Ireland peace process.

How are they proposing to keep the border open?

Both sides believe an eventual trade deal should resolve the issue.

But Brussels has insisted on a "backstop" arrangement as insurance to protect the border while a deal is negotiated.

EU proposals for a backstop keeping Northern Ireland inside the European customs area were rejected by Mrs May for effectively creating a border in the Irish Sea.

Her counter-proposal of a whole-UK temporary customs union was rebuffed by Brussels over the issue of Britain's unilateral right to pull out. It is understood that the draft agreement introduces a review mechanism for ending the arrangement.

What does the Withdrawal Agreement look like?

It is thought to run into hundreds of pages of detail on all aspects of the "divorce".

Alongside it is expected to be a shorter Political Declaration setting out a framework for future relations between the UK and EU in areas like trade and security co-operation.

What happens next?

British cabinet ministers were invited into 10 Downing Street this evening to read through documents.

They will gather for a special cabinet meeting to consider "next steps" at 2pm tomorrow.

Mrs May is expected to ask them to give their approval to the draft.

In Brussels, the EU's chief negotiator Michel Barnier would have to report to the European Council that "decisive" progress has been made in order for president Donald Tusk to convene a summit - probably in the last week of November - at which leaders of the remaining 27 EU states would be asked to put their stamp on the document.

The agreement would then be sent for ratification to both the Westminster Parliament and the European Parliament.

The government would hope to stage a vote in the House of Commons before Christmas. If every obstacle is cleared, the deal would come into effect in time for the UK's departure on 29 March 2019.

Is the British cabinet certain to give the plan its backing?

Far from it.

Mrs May is acutely vulnerable to resignations from her top team which could massively destabilise her position.

Staunch Brexiters in the cabinet like Liam Fox, Dominic Raab, Andrea Leadsom, Penny Mordaunt and Esther McVey must be convinced that the deal would not tie the UK too closely to Brussels.

What opposition will the draft agreement face in UK Parliament?

Mrs May will face resistance from Tory Brexiters like Boris Johnson and Jacob Rees-Mogg who fear that a deal could tie the UK indefinitely to Brussels, following rules which it has no part in shaping.

The DUP, which props up her minority government in the House of Commons, will challenge anything which treats Northern Ireland differently from the rest of the UK.

Remainers within the Conservative Party will argue that the draft offers worse terms than the UK already enjoys as a member of the EU.

Labour has said it will oppose any agreement which fails to support jobs and the economy and leader Jeremy Corbyn has already said the draft "is unlikely to be a good deal for the country".

EU-backing Liberal Democrats and the SNP are expected to vote against the deal.

What happens if the deal fails to win support in Westminster?

The default position is for the UK to leave the EU on 29 March without a deal, with the potential for chaotic scenes at ports and airports.

Mrs May is expected to use this as a powerful lever to persuade MPs to back her for the sake of stability.

However, there would also be huge pressure for a "People's Vote" second referendum to give the public the chance to decide whether it still wanted to go ahead with withdrawal.

And Labour would push for a general election to give someone else the opportunity to negotiate a better deal.