Theresa May has done a deal with the DUP which means she stays as UK prime minister. Here's a guide to what's going on.

What has happened?

Media playback is unsupported on your device Media caption Election 2017: Highlights of TV election night coverage

UK Prime Minister Theresa May called a general election, thinking she could increase her power ahead of Brexit talks. But it turned out she didn't do as well as hoped and her party no longer has a majority of members of parliament (MPs).

What was the result of the election?

Changed seats All seats Please enable Javascript to view our results map Con

Con Lab

Lab SNP

SNP LD

LD PC

PC UKIP

UKIP Ind

Ind DUP

DUP SDLP

SDLP UUP

UUP SF

SF Green

There are 650 MPs in the House of Commons - so any party getting more than 325 MPs has "a majority" because they are presumed to be able to win votes on all the things they want to do. Theresa May's Conservatives ended short of that total - getting 318 MPs (13 fewer than after the 2015 general election), Labour got 262 MPs (up 30), the Scottish National Party 35 (down 21), the Liberal Democrats got 12 (up 4) and the Democratic Unionists 10 (up 2).

So how come Theresa May is still prime minister?

Media playback is unsupported on your device Media caption Theresa May: "Let's get to work"

The Conservatives are still the biggest party in the House of Commons, and they have now agreed a deal with Northern Ireland party the Democratic Unionist Party (DUP), to have its support in key votes. The Conservatives' 318 MPs and the 10 DUP MPs together make up more than half the MPs in the House of Commons.

So are the Conservatives and the DUP in coalition?

No. A coalition normally means different parties agreeing on a joint programme and ministers coming from both parties. The Conservatives and the DUP have agreed what is called a "confidence and supply" agreement. This is where the DUP agree to back the Conservatives in key votes - such as a Budget and a confidence motion - but are not tied into supporting them on other measures. Read the full Conservative-DUP agreement.

What is in it for the DUP?

As well as the obvious influence and prestige of being involved with the UK government, there will also be £1bn more spent on Northern Ireland over the next two years than had previously been planned. They have also got agreement on a range of policy priorities - such as keeping the guarantee to increase state pensions by at least 2.5% a year, to maintain defence spending and to maintain agriculture spending in Northern Ireland at the same level for the rest of the current Parliament (which theoretically takes us to June 2022). Read more: Where the money will be spent

Who are the DUP?

Media playback is unsupported on your device Media caption The DUP: Partners in government

Basically, they are pro-union (UK, not Europe), pro-Brexit and socially conservative. The party is now the fifth largest in Parliament - its 36% share of the vote in Northern Ireland resulted in 10 MPs being returned to Westminster. It started as a one-man-band, with the Reverend Ian Paisley, a fundamentalist Protestant preacher, at its helm. He founded the party in 1971 in opposition to what he saw as the increasingly liberal approach of the Ulster Unionists - the party of the political establishment since the state was founded, in 1921.

Why is doing a deal with DUP controversial?

The DUP may be less overtly religious than it was in the days when the late Rev Paisley was in charge, but on social issues it is still deeply conservative. It opposes same-sex marriage and is anti-abortion - abortion remains illegal in Northern Ireland, except in specific medical cases. Ruth Davidson, the Conservative leader in Scotland, is gay and plans to marry her partner and had sought a guarantee from Mrs May that any deal would not affect gay rights. Many in Scotland and Wales are also concerned about special financial deals being struck for Northern Ireland.

What about the Good Friday agreement?

Sinn Fein, the SDLP and Alliance Party have said that a deal between the Conservatives and the DUP at Westminster would be likely to make power-sharing at Stormont more difficult. The former Labour Northern Ireland Secretary Peter Hain said a deal would "jeopardise the neutrality, the non-partisan stance, that a prime minister and a secretary of state must have in relation to Northern Ireland's politics". The UK government says Westminster business should be distinguished from its role in relation to the devolved administration. Theresa May says she hopes that all the parties in Northern Ireland will "come together and reach agreement to re-establish a power-sharing executive" by the 29 June deadline.

What about Brexit?

Theresa May justified calling a snap election on the basis that she wanted a larger majority of MPs, to strengthen her hand in negotiating the terms of the UK's withdrawal from the European Union. Brexit did not appear to have been the key issue in the election, however the fact that she has ended up with fewer MPs means there is now uncertainty over her strategy for the talks to come. Those arguing for a Brexit that maximises trading links - a policy Labour held - are feeling emboldened and claim the result showed voters rejecting Mrs May's vision for Brexit. The DUP, which has long been a Eurosceptic party, broadly shares Mrs May's Brexit strategy and has committed to back her in any votes on Brexit strategy. Read more: What result means for Brexit

So will Theresa May survive as prime minister?

Former Chancellor George Osborne, a man sacked by Theresa May when she became prime minister, has described her as a "dead woman walking". She had to jettison her two closest advisers to appease critics in the Conservative Party and had to agree to a more collegiate form of cabinet government. She is weakened, but at the moment it seems that there is little appetite among Conservative MPs for either another general election - given Jeremy Corbyn's rise during the one just finished - or a leadership contest to replace Mrs May. There is also, at the moment, little sign of agreement on who could be parachuted in to replace her in a "coronation".

What are the key dates for Mrs May?

Theresa May has got through the initial risk period, notably telling her backbench MPs "I got us into this mess, I'll get us out of it". The delayed Queen's Speech took place on Wednesday 21 June and the key vote on it is to take place on Thursday. The deal with the DUP means Mrs May is likely to win that vote - if she had lost it would be the equivalent of a vote of no confidence.

Why are Labour in such good spirits?

Media playback is unsupported on your device Media caption Jeremy Corbyn "ready any time" for another election

Although they did not get the most MPs, and got 40% of votes compared with 42.4% for the Conservatives, Jeremy Corbyn's Labour Party and its supporters have been celebrating their election performance. The reason for this is the way their support surged during the campaign, from below 30% in many opinion polls to 40%. Written off beforehand by many inside and outside his party, Mr Corbyn took everything thrown at him and has emerged as a man now firmly in charge of his party and, unlike before the election, being seen by non-supporters as having a realistic chance of becoming prime minister.

Is there likely to be another general election?

At the moment Theresa May and the Conservatives show no sign of wanting to risk incurring the wrath of voters by calling another election. Once bitten, twice shy and all that. Labour's Jeremy Corbyn is the candidate seen as on the rise, so why risk letting him build on the gains Labour made in this election? However you can't argue with the fundamentals, and the truth is that the Conservatives do not have a majority in Parliament, and Labour can't put together a coalition to secure a majority either. The aim appears to be to govern now for a full Parliament with DUP backing - but past precedent - 1974 when there were two elections in the year - would suggest that may be difficult to achieve.

Further reading:

Do you have an unanswered question about the political situation? Let us know.

Use this form to ask your question: