Brexit: What happens now?
The government's Brexit bill has completed its passage through the House of Commons and is now in the House of Lords.
The Brexit date - when the UK leaves the EU - is set for 31 January 2020.
The government's large majority meant that the EU Withdrawal Bill sailed through the House of Commons.
There will be attempts to amend the bill in the Lords but any significant changes would almost certainly be overturned by MPs.
It is expected to become law within days.
What happens after Brexit?
Assuming the European Parliament also gives the green light, the UK will formally leave the EU on 31 January with a withdrawal deal - and it will then go into a transition period that is scheduled to end on 31 December 2020.
During this period the UK will effectively remain in the EU's customs union and single market - but will be outside the political institutions and there will be no British members of the European Parliament.
Future trade deal
The first priority will be to negotiate a trade deal with the EU. The UK wants as much access as possible for its goods and services to the EU.
But the government has made clear that the UK must leave the customs union and single market and end the overall jurisdiction of the European Court of Justice.
Time is short. The EU could take weeks to agree a formal negotiating mandate - all the remaining 27 member states and the European Parliament have to be in agreement. That means formal talks might only begin in March.
The government has ruled out any form of extension to the transition period.
If no trade deal has been agreed and ratified by the end of the year, then the UK faces the prospect of tariffs on exports to the EU.
The prime minister has argued that as the UK is completely aligned to EU rules, the negotiation should be straightforward. But critics have pointed out that the UK wishes to have the freedom to diverge from EU rules so it can do deals with other countries - and that will make negotiations more difficult.
It's not just a trade deal that needs to be sorted out. The UK must agree how it is going to co-operate with the EU on security and law enforcement. The UK is set to leave the European Arrest Warrant scheme and will have to agree a replacement. It must also agree deals in a number of other areas where co-operation is needed.