The UK is negotiating its exit from the European Union after the country voted to leave in a referendum in June 2016.

As it stands, the UK will depart the EU on 30 March 2019 but the terms of its withdrawal and the nature of its future relationship with the EU are yet to be decided. So what is being discussed and by whom?

What's being discussed and when?

Image copyright Getty Images Image caption The one million British expats living on the continent are among those holding their breath for the outcome

In the first phase of negotiations, British and EU officials are meeting each month for four days in Brussels, the home of the European Commission.

So far, there have been two rounds of talks. The first one, in June, was largely a get-to-know you session in which both sides sized each other up, engaged in a few official pleasantries and discussed scheduling issues.

July's session was much more serious and detailed, with full discussions taking place in four key areas: the rights of EU citizens in the UK and Britons on the continent, the future of the 300 mile land border between Northern Ireland and the Republic of Ireland, general separation issues, and the question of money.

Matters are at an early stage and there has been no agreement in any of these areas yet. The two sides will next meet in the last week of August.

Who is doing the talking?

Image copyright European Commission Image caption David Davis and Michel Barnier are old sparring partners, having first dealt with each other in the 1990s

The UK team is led by David Davis, the veteran Conservative MP who is Secretary of State for Exiting The European Union. His EU counterpart is Michel Barnier, a former French foreign minister and EU commissioner who was chosen by the other 27 EU member states to represent them.

Both sides are deploying a Olympic-size squad of officials to work on the negotiations. Much of the spadework is being done by co-ordinators or "sherpas", senior officials whose job it is to pore over the nitty-gritty details and try and pave the way for a political agreement.

The lead British sherpa is Oliver Robbins, the top civil servant in the Brexit department.

Other key figures on the British side include Sir Tim Barrow, the UK's permanent representative in Brussels and Simon Case, David Cameron's former private secretary who is now director general of the UK-EU partnership, which is looking at post-Brexit co-operation.

Much progress so far?

Image copyright PA Image caption The government says its offer to EU citizens living and working in the UK is "serious and fair"

This is difficult to gauge and depends, to an extent, on which side you listen to.

The UK and EU have set out their respective positions on citizens rights, highlighting areas of convergence in green, disagreement in red and areas that need further discussion and "deeper understanding" in amber.

The UK is stressing what it regards as areas of consensus while pushing back on any suggestions that its offer is less generous than the EU's in terms of granting permanent residence, or settled status, to its three or so million EU residents, and accompanying rights, including of family reunion.

The EU has expressed mild disappointment at the UK's approach so far and there is genuine disagreement over how new guarantees will be legally enforced.

David Davis said the EU was only offering restricted residency rights to Britons living in the EU. The UK is questioning that.

Their offer "only guarantees residence rights in the member state in which a British national was resident at the point of our exit from the EU," he said in a letter to Lord Jay of the parliamentary committee on Brexit.

"It does not guarantee the holder of those residence rights any right to onward movement within the EU, for example to work or study in a neighbouring member state," he said.

Nor will the EU maintain existing voting rights for UK nationals living in the EU after Brexit, he said.

On the issue of finance, reports spoke of "robust" discussions about the UK's so-called "divorce bill" and the "need for flexibility" on both sides can be interpreted as diplomatic-speak for the two parties not seeing eye to eye.

The UK has spoken of "sorting out the obligations we have to one another" but media reports of the government being handed a "legacy" bill of up to 100bn euros (£89bn) has prompted a vociferous response from British ministers.

The reality appears to be that no detailed sums have been discussed yet and it has been widely reported any settlement is unlikely before the end of 2018.

One other running theme of the discussions so far has been the EU's constant plea for more clarity from British negotiators.

The UK has hit back, pointing out that it has been publishing position papers ahead of each round of negotiations, most recently on judicial proceedings, nuclear regulation and privileges and immunities.

The Irish dimension

Image copyright Reuters Image caption Upholding the Good Friday Agreement and the Common Travel Area are key priorities for the talks

Talks over the Irish border and related issues are being handled at the highest level, reflecting what the EU has acknowledged are the "unique circumstances and challenges" facing the island of Ireland.

For months, the joint mantra from both Dublin and London has been that after Brexit, the border between Northern Ireland and the Republic of Ireland should be as "seamless and frictionless as possible" and nothing should be done to endanger the peace process and political progress made over the past 25 years.

But cracks seems to be surfacing amid concerns in Dublin that technological solutions - such as number plate recognition and computerised trader schemes - are not sufficient in themselves to address the risk of smuggling and a wider political agreement is needed.

Unionist parties in Northern Ireland have reacted angrily to suggestions that customs controls could be moved to seaports and airports, rather than anywhere near the land border, which they say would create an unacceptable divide between Northern Ireland and the rest of the UK.

Given the fragility of power-sharing in Northern Ireland, and the frisson caused by the Conservatives' parliamentary pact with the Democratic Unionists, there seem to be real obstacles to overcome before this most sensitive of subjects is settled to the satisfaction of all.

What about trade?

Image copyright EPA Image caption Many carriers want an aviation agreement by the summer of 2018

The end of October, when EU leaders will hold their first post-summer summit, has been talked up as something of a watershed moment.

If the 27 agree that sufficient progress has been made on separation, rights and financial issues, it is possible they could agree to begin negotiations on trade and the all-important question of the UK's future relationship with its largest commercial partner.

The UK had wanted talks on divorce and trade to take place in tandem but the EU said no, also insisting that no agreement on a future trade deal - which would involve a new treaty - can be finalised until the UK has actually left the EU.

More recently, EU sources have suggested that October is not set in stone and any decision could slip until the end of the year.

As we move into 2018, there will be attention on areas vital to the British economy such as financial services, aviation and agriculture.

Airlines have said agreement on the UK's future within the European Common Aviation Area and its participation in the Open Skies transatlantic system is needed by the summer of 2018 to allow them to schedule flights six months ahead.

There have been warnings of chaos and passengers not being able to travel in and out of the UK.

Is the UK government united?

Image copyright AFP Image caption Downing Street has sought to downplay the extent of cabinet divisions over Brexit

In a major speech in January, Theresa May committed the UK to leaving the EU's single market and the customs union, saying the UK must be able to control its own borders and negotiate its own trade agreements with other countries.

At the same time, she said the UK wanted tariff-free trade with the EU after Brexit and a new customs agreement. She also talked of an "implementation period" after the UK leaves the EU and an end to the jurisdiction of the European Court of Justice (ECJ) as the supremacy of EU law ceases.

This government line generally held firm during the general election campaign but has come under pressure since the Conservatives lost their Commons majority, with several cabinet ministers breaking ranks to emphasise what they see as their priorities for the negotiation.

Chancellor Philip Hammond has made it clear that economic stability and business certainty is paramount and suggested there is cabinet support for a transitional period of up to three years in which the status quo would be maintained in many areas to help business to adjust.

Brexit-supporting colleagues, such as Liam Fox and Michael Gove, have indicated they have no objection to the principle of a phased transition.

But the devil will be in the detail and many Tory MPs are likely to fiercely resist any concessions which would allow the free movement of people from the EU to continue in its current form - something Downing Street has ruled out - or which would give the ECJ any interim role.

Will a deal be done and by when?

Image copyright Reuters Image caption Some MEPs have suggested the agreement of the European Parliament is by no means guaranteed

Mr Barnier has not been slow to remind British officials that the "clock is ticking" on the negotiations.

What was, by general agreement, a very tight two-year process to start off with has been further condensed by the UK's snap general election, which meant a two-month delay to the start of talks.

While EU summits in March and June 2018 will be important staging posts, the real crunch is expected to come in the autumn of 2018.

A deal will effectively have to be agreed by this point if it is to be approved by Parliament, the European Parliament and by EU states - 72% of whom will have to vote for it under super-qualified majority rules - in time to meet the Article 50 withdrawal deadline.

With the EU sticking to its mantra that "nothing is agreed until everything is agreed", this period could become what one football manager famously described as "squeaky bum" time.

The UK could leave before March 2019 if a withdrawal agreement is agreed earlier, although this would seem unlikely at this stage.

There also remains the possibility that the UK could simply leave without any agreement, if either of the two sides reject a deal or can't agree on one and decide against extending the talks.

For many critics of Brexit, this is the doomsday scenario but many Leave supporters are relaxed about what it would entail. The government says it is preparing for every eventuality but believes it will secure a deal that works for both sides.