Image copyright Getty Images

Theresa May has written a letter to the British public pleading for their support for her Brexit deal, as the EU prepares to sign it off.

The prime minister said her agreement promises a "brighter future" for the UK and leaving the EU next year will be "a moment of renewal and reconciliation for our whole country".

EU leaders are in Brussels for a summit to decide whether to endorse the deal.

European Council chief Donald Tusk has recommended all countries approve it.

The president of the European Commission, Jean-Claude Juncker, said saying goodbye to the UK was "not a moment of jubilation" but a "tragedy" for the EU.

He added that, although this was the "best possible deal" for both sides, there were "no smooth divorces".

Spain - which had threatened to boycott the summit - will attend after a last-minute disagreement over Gibraltar was resolved on Saturday.

However, even if the EU agrees to the deal, it needs to be passed by the UK Parliament. Many MPs - including in Mrs May's own Conservative Party - have stated they will vote against it.

What does the PM's letter say?

In Mrs May's "letter to the nation" - published on the eve of the EU summit where she hopes the 27 other EU countries will back her deal - the PM claims the deal is "in our national interest" and works for all parts of the UK.

Media playback is unsupported on your device Media caption Michel Barnier: "Time for everybody to take responsibility."

Leaving the EU on 29 March 2019 will mark "a new chapter in our national life," she said.

"It must mark the point when we put aside the labels of 'Leave' and 'Remain' for good and we come together again as one people.

"To do that we need to get on with Brexit now by getting behind this deal."

The prime minister said she would be campaigning "with [her] heart and soul" to get MPs to pass the deal in the House of Commons and "honour the result of the referendum".

She said the deal delivers on Brexit by ending free movement of people and "vast" annual payments to the EU.

"With Brexit settled", the government will be able to focus on issues such as the economy, the NHS and building homes, she added.

Analysis

BBC political editor Laura Kuenssberg

The end of the negotiations. But not the end of the arguments Theresa May has to make about our relationship with the rest of the continent.

Today - Number 10 hopes - marks the end of months and years of negotiations, not just with Brussels. But, with a bigger aspiration: to bring the country together.

But, while a deal is expected to be signed off in Brussels today, whatever the last minute jitters, Theresa May will know, pitching her agreement to the EU is one thing, persuading Parliament another, and ultimately what will determine her and all of our futures is whether the public is willing to come on board.

What will happen at the summit?

Image copyright Reuters Image caption The leaders are expected to have a two-hour discussion

Image copyright AFP Image caption The negotiating teams have finished their work - for now

On Sunday morning, EU leaders will be asked to approve two key Brexit documents:

The political declaration, which sets out what the UK and EU's relationship may be like after Brexit - outlining how things like UK-EU trade and security will work.

The EU withdrawal agreement: a 585-page, legally binding document setting out the terms of the UK's exit from the EU. It covers the UK's £39bn "divorce bill", citizens' rights and the Northern Ireland "backstop" - a way to keep the border with the Republic of Ireland open, if trade talks stall.

There is no formal vote on Sunday but the EU expects to proceed after reaching a consensus, with the agreement likely to be approved.

Arriving at the summit, the EU's Brexit negotiator Michel Barnier said he hoped the agreement would "build trust" between the two sides and pave the way for an "unprecedented and ambitious" future partnership.

But in an apparent reference to the vote in the UK Parliament, he insisted he had "never worked against the UK" and it was "now time for everybody to take their responsibility".

Irish prime minister Leo Varadkar said the negotiations had been "very difficult" but the deal reached would allow for the UK's "orderly withdrawal".

What happens afterwards?

If the EU signs off the withdrawal deal, Mrs May will then need to persuade MPs in the UK Parliament to back it.

A vote is expected in December. Labour, the Liberal Democrats, the SNP and the DUP have all said they will vote against the government's deal, as well as many Conservatives.

The agreement will also have to go back to the European Council, where a majority of countries (20 out of 27 states) will need to vote for it.

Media playback is unsupported on your device Media caption What's in the political declaration?

It will also need to be ratified by the European Parliament, in a vote expected to take place in early 2019.

If MPs reject the deal, a number of things could happen - including leaving with no deal, an attempt to renegotiate or a general election.

According to the Sunday Times, Chancellor Philip Hammond is working with other Cabinet ministers to try to persuade Mrs May to opt for a softer Brexit deal, which they believe could get through Parliament if her original deal is rejected.

And the Sunday Telegraph reported several senior ministers are working on a plan B - for a Norway-style relationship with the EU.

Please upgrade your browser Your guide to Brexit jargon Enter the word or phrase you are looking for Search

What are Mrs May's critics saying?

Labour MP Ian Murray called the 800-word letter an "utter work of fiction" while his colleague Yvette Cooper said Mrs May had "failed to build a consensus" at any point during the 20-month negotiating process.

Among the Conservatives, Tory MP Sarah Wollaston called for a further referendum on the deal, and said: "Not a brighter future, just dimmer and diminished."

Meanwhile, writing in the Sunday Express, leading Tory Brexiteer Jacob Rees-Mogg - who has previously called for Mrs May to be replaced as party leader - claimed the deal "does not deliver on Brexit".

Former UKIP leader Nigel Farage, who heads the Europe of Freedom and Direct Democracy grouping in the European Parliament, told the BBC it was the "worst deal in history" and he, as an MEP, would vote against it.

But he conceded there was a risk that if the UK Parliament rejected it, it might be "unpicked" by those who wanted to restart the negotiations or hold another referendum.

Why was Spain unhappy?

Spain threatened to not show up over concerns about its role in future trade arrangements involving Gibraltar - a British Overseas Territory with 30,000 residents.

But it dropped its threat after saying it had received assurances from the UK.

The Spanish PM Pedro Sanchez claimed the UK and EU had agreed to its demands but BBC Europe correspondent Kevin Connolly said UK assurances did not contain anything substantially different from the withdrawal agreement.

He said there was a suspicion that Spanish ministers were "showboating a little for the domestic electorate" on the eve of elections in the south of Spain.