What is really going on in politics? Get our daily email briefing straight to your inbox Sign up Thank you for subscribing We have more newsletters Show me See our privacy notice Invalid Email

Theresa May has finally clinched an agreement on Brexit after a pre-dawn trip to Brussels that's saved her career - for now.

After all-night talks the PM sealed the deal on three key issues - Northern Ireland, the divorce bill and the rights of 3.2million EU citizens living in the UK.

That means, if agreed by 27 EU leaders, Britain can finally move on to start talking about its trade with the Continent after March 2019.

She grinned today as she met European Commission President Jean-Claude Juncker and his chief of staff tweeted a picture of white smoke - a symbol for choosing the new Pope.

But she warned: “It hasn't been easy for either side.” Mr Juncker added: "Today's result is, of course, a compromise".

(Image: PA) (Image: REUTERS) (Image: AFP)

The DUP , who were worried about Northern Ireland, signed off the document but said it wasn't perfect.

So what does the full, very complicated 15-page document say in plain English and where has she compromised? Here's a summary.

Northern Ireland border

This is about finding an arrangement for Northern Ireland that doesn't cut it off from either the Republic - which is part of the EU - or the rest of the UK. This was a key sticking point with the DUP.

(Image: AFP)

(Image: REUTERS) (Image: AFP)

Everyone's kicked the can down the road.

The agreement commits to guaranteeno hard border between Northern Ireland and the Republic - whatever happens.

But at the same time, Northern Ireland will get unfettered access to the internal UK market - even though the UK is leaving the EU's single market and customs union.

The UK wants to secure Northern Ireland's status without any special treatment through an overall EU-UK deal later in the process.

If that's not possible, however, the whole of the UK WILL get "full alignment" with SOME current EU rules shared across the island of Ireland. This could be a big step to soft Brexit.

It'll be about specific rules that support north-south co-operation, the all-island economy, and the protection of the Good Friday Agreement.

(Image: PA)

The words "regulatory alignment" - which enraged the DUP so much they called Mrs May midway through a lunch to scupper a previous deal - have been dropped from the agreement.

But there could still be "regulatory barriers" between Northern Ireland and the UK in future, the Northern Ireland government will just get a veto on them.

Meanwhile, the UK and Ireland can continue to sort out between them people's rights to move across the border under the Common Travel Area. This will not affect Ireland's obligations under EU law.

And Irish Premier Leo Varadkar said Northern Ireland citizens can continue to "exercise his or her right" to EU citizenship.

Citizens' rights

This is about ensuring the 3.2million EU citizens in Britain, and 1.2million Brits living in the other 27 EU nations, can stay after Brexit . Theresa May refused to give a firm promise until she had one for UK citizens.

(Image: REUTERS) (Image: PA)

Britain and the EU have now agreed a reciprocal deal, so everything that applies to Britain (below) will apply to the other 27 countries too.

This is a major breakthrough for Mrs May 534 days after Britain voted to leave. But it's come at a cost.

In a move that could enrage Tory Brexiteers, the deal says UK courts will follow the European courts for eight years after exit when deciding on citizenship issues.

Downing Street insisted the eight-year power will be 'entirely voluntary' for Britain to follow or not, and only cover two to three cases a year.

If an EU citizen is living legally in Britain before March 2019, a huge range of relatives will all have the right to move to Britain - for the lifetime of the person already living here.

That includes their spouses, registered partners, children and grandchildren ("direct descendants") under 21 - even if they're not born yet - and spouses' dependent direct relatives.

(Image: PA)

Mrs May's plan to force EU citizens to apply for "settled status" appears to be intact - she wanted to let people apply after they've been in Britain for five years.

But the arrangements must be "transparent, smooth and streamlined", the deal says.

People who've settled in Britain can now leave for up to five years without losing their settlement rights. Theresa May wanted it to be just two years.

Residence documents must be issued either free of charge, or no more expensive than similar documents would be for UK nationals.

A "proportionate approach" will be taken to those who "miss the deadline with good reason".

People who already have UK residence documents issued under EU law must have them converted to the new status free of charge - with only a security and background check.

Benefits and healthcare arrangements will continue as they are now for people living in a country under the agreement before 29 March 2019.

But in ablow for expats, there's no deal on whether UK citizens settled in the EU will be able to move to other EU countries freely, or will be fixed in the country they're in now.

How Theresa May's all-night Brexit deal unfolded After a week of pain and 534 days since the referendum, there was no single moment when Theresa May knew she'd clinched a deal on 'Phase 1' of Brexit talks. But hopes were raised after she spoke to EU Commission President Jean-Claude Juncker and Irish Premier Leo Varadkar at about 7.30pm on Thursday night. The Prime Minister then had two crucial phone calls with DUP leader Arlene Foster - one at 9pm, one at 11pm - and the deal was agreed by midnight. All the while the Downing Street staff Christmas party was going on around her. Aides refuse to say if she had any champagne. At 12.02am, her chief whip Julian Smith gave the game away. "I will continue to do everything I can to ensure that the views of @Conservatives MPs are fully reflected in phase 2," he tweeted. Despite the swirling rumours, the PM popped off to bed for a couple of hours before setting off at 3.45am for RAF Northolt. The red-eye flight lifted off to Brussels at 4.30am. She and her Brexit chief David Davis had a 6am UK time breakfast of Actimel, orange juice and bread with Mr Juncker and his chief negotiator, Michel Barnier, where they sealed the deal. While they were still inside, powerful EU aide Martin Selmayr tweeted a photo of white smoke - the symbol of choosing a new Pope. Finally, Mrs May and Mr Juncker emerged to say it had been done at 6.30am UK time. With that she whisked herself off and was back in the UK by 9.30am.

Divorce bill

This is about agreeing how much Britain should continue to pay in to the EU before (and after) it leaves. Boris Johnson once said the EU should 'go whistle' - but it's now up to £39bn.

(Image: AFP)

"We've now agreed a settlement that is fair to the British taxpayer," said Theresa May. "We will be able to invest more in our priorities at home, such as housing, schools and the NHS."

But one thing's for sure - it won't be £350million a week.

Downing Street admitted the bill would be 40 to 45billion Euros - or £35billion to £39billion.

Asked if it was too much after Boris Johnson accused the EU of "extortion" and told them to "go whistle", Theresa May's spokesman said: "We would look at it as a fair settlement of our obligations."

There is no one figure in the document, but the "methodology" is now agreed.

Britain will carry on paying in to the EU budgetin 2019 AND 2020 "as if it had remained in the EU", even though it leaves in March 2019. This is set to add billions to the final bill.

(Image: REUTERS)

The financial settlement itself will be drawn up and paid in Euros - meaning Britain will lose out because the pound plummeted on referendum night.

The pound rallied to a six-month high after today's announcement, trading at 1 Euro and 14.8 cents. But it was still well below its rate on June 23 last year.

Britain will have to pay its share of budget commitments "outstanding at 31 December 2020".

It will take 12 YEARS to be repaid the huge pot Britain has in the European Investment Bank. The sums will be repaid in instalments of 300million Euros a year.

Britain will honour commitments it made before 2019 for refugees in Turkey.

It will also continue to pay into the European Development Fund in full until the current round ends in 2020.

So what comes next?

(Image: AFP)

If the resolution is agreed by 27 EU leaders at a summit next Friday, Britain can finally start Phase 2 - talking about its trade with the Continent after March 2019.

As Tories traded messages of triumph, Brexiteer Cabinet minister Michael Gove declared: "The final whistle blew this morning and Theresa May won."

But there are stark warnings about the future.

European Council President Donald Tusk said during a transition period after 2019 “the UK will respect the whole of EU law, including new law” - which is a total red line for Brexiteers.

And he said the UK must follow European courts, pay into the EU budget and "all related obligations" during that transition, which he said "seems to be the only reasonable solution". That could mean extending payments to 2021 at least.

Mr Tusk said today’s agreement “is obviously the personal success of Prime Minister Theresa May” but warned: "We all know the most difficult challenge is still ahead. So much time has been devoted to the easier part of the task."

Downing Street left open the option of staying in the single market or customs union during a transition period - but insisted Britain WOULD be leaving both.

A spokesman insisted: "We remain confident we can achieve the trade deal within the Article 50 timeframe."

But the DUP told the BBC: "We cautioned the Prime Minister about proceeding with this agreement in its present form given the issues which still need to be resolved and the views expressed to us by many of her own party colleagues.

"However, it was ultimately a matter for the Prime Minister to decide."

Irish premier Leo Varadkar told journalists: “This is not the end, but it is the end of the beginning and we will remain fully engaged and vigilant throughout Phase 2."

But muddying the waters again, he once again said “full regulatory alignment I think is very helpful” - even though that phrase was left out of the agreement.

Labour's Shadow Brexit Secretary Sir Keir Starmer said agreement was "two months later than originally planned", and he is correct.

He added: "We will also need to know the political price of the deal struck and the impact any compromise that has been agreed will have on our future relationship with the EU.

“As the talks now move on to a discussion about Britain’s future relationship with the European Union, Theresa May must seriously reflect on her approach to the negotiations so far.

"We cannot have another year of chaos and confusion or the farcical scenes we saw earlier on in the week that put jobs and the economy at risk.”