The general election has ended in a hung Parliament, where no party has the 326 seats needed to get an overall majority in the House of Commons.
So what happens now?
Who is the prime minister?
Theresa May remains the prime minister, and the Conservative government stays in office, until it is decided who will attempt to form a new government or unless she decides to resign.
Will the Conservatives form the next government?
Not necessarily. The party with the most MPs is normally described as the winner and its leader nearly always goes on to become the next prime minister.
But in a scenario like this, when no party has enough MPs to form a majority, it is possible for the party that came second to form a government with the help of other parties.
Labour, which finished second, has indicated it will seek to form a minority government (see below).
What happens now?
Theresa May or Jeremy Corbyn could opt to go it alone and try to run a minority government, relying on the support of smaller parties when needed to get their laws passed.
Or there may be a frenzied round of talks between the party leaders and their negotiating teams, as they try to put together another coalition government or a looser deal.
Image copyrightGETTY IMAGES
Who gets the first go at putting together a deal?
Theresa May, whose party looks set to get 319 seats, can stay on as prime minister while she tries to put a majority together.
If it becomes clear that she can't and Jeremy Corbyn can, then she will be expected to resign. Mr Corbyn would then become the prime minister.
But the Labour leader does not have to wait until Mrs May has exhausted all her options before he starts trying to put a deal of his own together. He can hold talks with potential partners at the same time as Mrs May. They may even be talking to the same people.
How long will it take?
There is no official time limit. It took five days to put the coalition together in 2010 but it is generally expected to take longer than that.
At the moment the first deadline is
Tuesday 13 June, when the new Parliament meets for the first time. Mrs May has until this date to put together a deal to keep herself in power or resign,
according to official guidance issued by the Cabinet Office.
But Mrs May must be clear that Jeremy Corbyn can form a government and that she can't. She is entitled to wait until the new Parliament to see if she has the confidence of the House of Commons.
What if it is still not clear a new government can be formed?
The government needs to see if it can assemble the votes it needs to get its programme of proposed new laws passed in the Queen's Speech, which is scheduled for
Monday 19 June.
Theresa May may opt to remain in power and gamble on getting enough votes from other parties to get her programme passed.
If she has already resigned and handed over to Mr Corbyn, this will be the key test of whether the Labour leader can form a government.
What is a minority government?
The Conservatives or Labour could try to form a minority government, filling all the ministerial positions themselves.
This party would be unable to pass laws and legislation without the votes of other parties that are not part of the government.
For example, Labour could be a minority government with Jeremy Corbyn as prime minister - but would likely require the votes of the Scottish National Party and Liberal Democrat MPs to get things done.
How many MPs would a minority government need for it to be a feasible option?
A party could fall well short of an outright majority and still run a minority government.
A new Conservative or Labour government would also face a fractured opposition - other parties would all have to gang up together to vote against it. This would not happen very much in practice. It is not enough for the losing parties to have more MPs than the "winner". They have to be able to form a coherent alternative.
What about a coalition?
Image copyrightPA
Image captionDavid Cameron and Nick Clegg led a coalition after the 2010 general election
A coalition is when two or more parties join forces to govern as a single unit. The junior partners are given ministerial jobs and a joint programme for government is set out.
This seems less likely than in 2010, when the Conservatives and Lib Dems teamed up, given the numbers involved and the parties' statements.
Northern Ireland's Democratic Unionist Party has suggested it could back the Tories and would be vital in helping them to govern in a hung parliament, but this would more likely be on a day-by-day arrangement.
Jeremy Corbyn could lead a coalition with the SNP and the Lib Dems - although this is something he has so far said he would not do, and in any case the three parties do not have the numbers to secure a Commons majority.
The Lib Dems have said that there will be "no coalition" and "no deals" from them while SNP leader Nicola Sturgeon said she "would look to be part of a progressive alliance that pursued progressive policies".
The Green Party, which has one MP, Caroline Lucas, said it would never back a Tory government but could support Labour on a vote-by-vote basis.
Will there be another election?
Image copyrightPA
Possibly.
In the past, when minority governments have been formed at Westminster, the prime minister has held another election at the earliest opportunity to try and gain a working majority. Or the opposition has forced another election by tabling a "confidence" motion.
The Fixed-Term Parliament Act - passed by the Lib Dems and Conservatives to make their 2010 coalition less likely to collapse - means an election can only be held if:
- Two-thirds of MPs vote for it. In practice, it would need to be supported by both Labour and the Conservatives.
- If MPs pass a motion of no confidence in the government AND an existing or new government cannot win a confidence vote in the Commons within 14 days of the no-confidence vote
What will happen to the Brexit talks?
The talks are currently due to begin on 19 June but if it takes a while to form a government it could ask the EU for a delay.
However, Mr Corbyn says they have to go ahead as planned with the "government of the day" taking part.
The EU Parliament's chief negotiator said the outcome "will make already complex negotiations even more complicated".
What role does the Queen play?
The leader of the party that can tell the Queen they have a workable Commons majority is the one Her Majesty will authorise to form a government.
By convention, the Queen does not get involved in party politics, so there are no circumstances in which she would choose the prime minister.
There have been suggestions that she may not deliver the Queen's Speech in person if there's a question mark over whether it will get voted through.
Is there any way round this?
We are in uncharted waters here.
Britain does not have a written constitution and experts are divided over what may happen if no one can form a government.
Here are some alternative scenarios:
- If a "no confidence" motion is passed in the Commons, the prime minister could hand the party leadership to a colleague, who could have another try at winning a confidence vote before the 14-day grace period is up
- The prime minister could resign, after being defeated on the Queen's Speech for example, and hand power to the leader of the opposition, who would then attempt to govern. This raises the prospect of a change of governing party without an election - something that has never happened in Britain and would be likely to trigger a constitutional crisis