Brexit: Key dates and potential hurdles - BBC News
Britain is leaving the EU in March next year - but much has to be sorted out before that happens.
When MPs return from their summer recess, Britain's departure from the EU will be fast approaching. Here are the key dates and parliamentary battles on the road to Brexit.

Ratification of the withdrawal agreement by the UK Parliament and the European Parliament.

If and when ministers return with a deal, MPs will vote on the withdrawal agreement and the framework for the future partnership. This will act as the "meaningful vote" promised to MPs by the prime minister.

The rules surrounding what happens if things don't go to plan were written into law in the Withdrawal Act: In the event that MPs refuse to approve the withdrawal agreement or no deal is reached by 21 January 2019, the government will have to present its plans for next steps to Parliament. MPs will then be able to vote to endorse the statement.

Soon after the withdrawal agreement has been finalised (expected by the end of October 2018). The government has said the vote will take place before the European Parliament votes on the agreement.

This vote is potentially the biggest threat to the government's plans. Ministers have presented the vote as a decision between approving their withdrawal agreement and "no deal".

Assuming the Opposition votes against the agreement, the government's fate will lie in the hands of its own backbenchers. MPs who support a hard Brexit, such as Jacob Rees-Mogg, have made it clear they would be prepared to vote against the deal if it does not prove sufficient, but the pro-Remain Conservatives could also join Labour in the voting lobbies if they are unconvinced.

A complex but crucial factor is what happens in the case of no deal or Parliament's rejection of the deal. The final version of the Withdrawal Act stated that in the case of no deal by January or MPs rejecting a deal the government would have to present its new plans to MPs in a "neutral motion". This could be along the lines of "This House has considered" the government's plans for next steps, giving MPs little power to influence the plans.

However, if Speaker John Bercow decides the motion is amendable, MPs could change its wording. They could theoretically change the motion to direct the government on their next steps.

Enter the word or phrase you are looking for

Another law that needs to be passed before the UK leaves the EU. It will enshrine the withdrawal agreement in law and give legal effect to whatever transition period is agreed. The difference between this and the motion in Parliament is that the motion is there to approve the withdrawal agreement while the bill is there to implement it.

The bill probably cannot be written until there is a withdrawal agreement and it must be passed before Brexit day (29 March 2019). MPs complicated the process in December when they passed an amendment to the Withdrawal Bill - proposed by Conservative MP Dominic Grieve - that would require this bill to be passed before the government can use secondary legislation to implement Brexit. This means the vote on this bill will act as another "meaningful vote".

It is unclear what would happen if Parliament rejected the bill.

Under the Withdrawal Bill, the government has the power to make changes to laws that need to happen before Brexit day. This is called secondary legislation and is often used to make small technical changes to laws. But opposition politicians have warned that excessive use of these powers could be undemocratic.

The powers are contained in the Withdrawal Act. But after MPs voted for Mr Grieve's amendment, ministers will not be allowed to use the powers until the Withdrawal Agreement Bill has been passed.

The final withdrawal agreement will have to be ratified as an international treaty. The government has to present international treaties to both Houses of Parliament. If neither House raises objections, the treaty is passed and does not necessarily have to be debated or voted on.

If there is an objection, ministers have 21 days to explain the merits of the treaty, before presenting it to Parliament again. This could technically be repeated several times.

The government has said the treaty will have to be ratified before the withdrawal agreement can "enter into force".

It is unlikely that there would be a vote - or even a debate - on the treaty, seeing as the issues will have already been debated and voted on in the meaningful vote. Theoretically, Parliament could vote against the treaty, but it will not be able to amend it.

Of course, this all depends on them having a treaty to ratify…

The EU and the UK have to agree on the terms of the UK's departure - as well as agreeing the outline for the trading relationship they will have after Brexit.

Here are the main issues that need to be sorted out (there are a lot of smaller ones too - you can read more about those here).

This is the biggest sticking point.

Both sides have committed to avoiding the return of a hard border, including physical infrastructure or related checks and controls, between Republic of Ireland and Northern Ireland.

They want to achieve this by agreeing a new trade deal with the continuation of open borders. But in the event that this is not possible both sides have agreed to have a "backstop" solution that would keep the Irish border open.

Brussels' proposed solution would see Northern Ireland stick to those rules of the customs union and single market that are required for cross-border co-operation to continue.

But the UK government is against this idea, saying it would effectively separate Northern Ireland from the rest of the UK and create a border in the Irish Sea.

Instead the UK would like to see the backstop apply to the entire UK, but negotiators are yet to find a solution that is acceptable to both sides.

The sides must still agree on what terms Gibraltar will be able to participate in the transition agreement.

The EU's negotiating guidelines state that "no agreement between the EU and the United Kingdom may apply to the territory of Gibraltar without the agreement between the Kingdom of Spain and the United Kingdom", which some have interpreted as the EU giving the Spanish veto over the final deal.

Madrid is said to be seeking joint management of Gibraltar's airport and greater co-operation on tax fraud and tobacco smuggling in return for allowing the withdrawal agreement to cover the Rock.

The UK and the EU will also have to find a solution for British military bases in Cyprus.

The UK has set store by establishing a high level of co-operation on security issues, like counter-terrorism and the fight against organised crime, with the EU after Brexit.

But there are significant disagreements about how this will work - and the EU's decision to exclude the UK from the Galileo satellite system on security grounds was said by the UK to show a lack of trust.

The UK thinks that co-operation on extradition, the British relationship with the EU crime-fighting agency Europol and the sharing of criminal records should be the subject of a separate security treaty which the two sides should begin negotiating straight away.

This is another issue that could bring the whole deal down, according to Michel Barnier.

The UK is committed to pulling out of the European Court of Justice, the mechanism used to settle disputes between member states by interpreting and enforcing single market rules - but it does want to stay close to some of the EU's rules.

The EU has proposed a joint committee made up of representatives appointed by London and Brussels. If they can't solve a problem, it would be referred to the European Court of Justice.

The UK government likes the idea of a joint committee but not of the European Court of Justice having the final say in all circumstances and only wants certain cases referred by the committee to the ECJ.

This is how the Brexit process is meant to go - but the UK or the EU could pull the plug on talks at any time. And, in theory, the UK and the other 27 EU members could agree to change the timetable or even halt the process Brexit altogether.

As the European Commission likes to say, "nothing is agreed until everything is agreed".