The UK general election has ended in a hung parliament, meaning no party has overall majority. So what happens now?
Will the party with the most MPs form the next government?
Not necessarily. The party with the most MPs, when the votes have been counted in all 650 constituencies, is normally described as the winner and its leader nearly always goes on to become the next prime minister.
But that might not happen this time with an inconclusive result. It is possible for the party that came second to form a government with the help of other parties.
How does someone win the election?
The easiest way to become prime minister is to win what is called a majority in the House of Commons - a majority is where your party has more MPs than all the other parties put together.
The finishing line is 326. That would be enough for a government to vote through new laws without being defeated by their opponents. If they don't reach that number we have got what is called a hung parliament.
What is a hung parliament?
When no single party can get enough MPs to form a majority on its own the parliament is said to be "hung". This happened at the 2010 general election.
What happens now?
In a hung parliament, the Conservative government will remain in office - and Theresa May can live in Downing Street - until it is decided who will attempt to form a new government or unless she decides to resign.
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 to put either Mrs May or Labour leader Jeremy Corbyn (the only two people with a realistic chance) into power as prime minister.
Or one of the two party leaders 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.
Who gets the first go at putting together a deal?
Theresa May, whose party looks set to get 318 seats, can stay on as prime minister while she tries to put a majority together.
If it becomes clear that she can't and Mr 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.
Negotiations can't go on indefinitely, surely?
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 Mr 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.
Mrs 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 will happen to the Brexit talks?
They could be delayed if there is a hung parliament or Mr Corbyn becomes PM. 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.
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 she 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.
What is a coalition?
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.
Will there be another coalition this time?
It seems less likely than in 2010. It depends on four factors:
- Whether the potential coalition partners have enough MPs between them to command a workable majority.
- Whether the biggest party wants to do it or would prefer to try governing alone as a minority government.
- Whether the potential partners can convince their respective parties that it is a good idea.
- Whether they can find enough common ground on policy - the junior partners will inevitably have to ditch some of their policies but they will insist on keeping others.
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.
Mr 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.
But his shadow foreign secretary, Emily Thornberry, said the party would attempt to force through a Queen's Speech and ask the SNP, Lib Dems and Greens to back it.
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".
But she also criticised Mr Corbyn, saying he was not "credible as an alternative prime minister".
The Green Party, which currently has one MP, said it would never back a Tory government but could support Labour on a vote-by-vote basis.
What is a minority government?
If the Conservatives or Labour are unable to put together a coalition or decide to go it alone, they can 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 Mr 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. For it to be defeated, the Lib Dems, SNP, UKIP, Plaid Cymru, the Greens and the DUP 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.
So the party that finishes second in the election could form a government?
Yes. Although there is a question mark over whether the public would accept it.
How stable would a minority government be?
Britain has had minority governments before, although they have rarely lasted long.
The SNP governed in Scotland as a minority government between 2007 and 2011. It means the government has to form alliances and deals with smaller parties to secure their support in Commons votes - but they can achieve some stability by entering into a "confidence and supply" agreement with another party.
Will there be another election?
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
After parliament is dissolved there are 25 working days until an election is held.
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