Next week, Boris Johnson or Jeremy Hunt will become the UK’s new prime minister.
Both have ruled out holding a general election before the 31 October Brexit deadline. However, some MPs say they are willing to trigger one.
So, how soon could the UK be going back to the polls?
Is an election inevitable?
There is nothing in law that says Mr Johnson or Mr Hunt must hold a general election when they take over from Theresa May.
As long as the Conservatives remain in power, the new party leader becomes prime minister automatically, as long as they continue to have support from most MPs.
This is not unprecedented. When Gordon Brown took over as Labour prime minister from Tony Blair, in 2008, he waited until 2010 before holding an election.
A UK Parliament lasts for a maximum of five years. As the last general election was held in 2017, the next one would be due until 2022.
Can the prime minister hold an early election?
The prime minister used to be able call an early election when they wanted to.
That changed in 2011, when a law called the Fixed Term Parliaments Act was brought in.
Now, a prime minister needs the votes of 66% of MPs to call an early election.
Theresa May used this power to hold the 2017 general election – just two years after the previous poll.
The new prime minister could do the same – in the hope of winning more seats, to make it easier to pass new laws and deliver Brexit.
However, this scenario seems unlikely as both leadership candidates say they are against a snap election.
Could a prime minister be made to have an election?
Both Mr Johnson and Mr Hunt have refused to rule out the possibility of a no-deal Brexit. This would see the UK immediately leave the European Union (EU) with no agreement about the “divorce” process.
That worries some MPs, most of whom are against a no-deal Brexit. They fear it could harm the economy and lead to border posts in Ireland.
In order to stop a no-deal, MPs could try to defeat the government in a “vote of no confidence”.
In this procedure MPs have to decide whether they want the current government to continue. For the vote of no confidence to succeed, it might require some Conservative MPs to vote against their own government.
If this passes, the Fixed Term Parliaments Act allows the government to stay on for 14 days, to try to persuade MPs to change their minds.
Other parties might also try to come together to form a government during this period – but this would require the current prime minister to resign.
If nothing is resolved after 14 days, a general election is automatically triggered.
If such a scenario plays out, the new prime minister – Boris Johnson or Jeremy Hunt – would still not have to resign.
But he would have to advise the Queen when the election will happen. Traditionally, this would be as soon as practically possible.
Once the date is known, Parliament shuts down – or dissolves – 25 days before the poll. This allows MPs to campaign for re-election.
How soon could a general election happen?
An early election would depend on how soon any vote of no confidence was passed.
Parliament is due to break up for summer on 25 July – just one day after the new prime minister officially starts.
If MPs managed to organise and pass a no confidence vote on the final day, the 14-day period would end on 8 August.
Assuming the government didn’t regain the confidence of MPs, the House of Commons Library says that either Thursday 19 or 26 September would then be the most likely date for a general election.
That would give the winner of the election just over a month to decide what to do about the 31 October Brexit deadline.
If, on the other hand, MPs don’t hold a no confidence vote before the summer break, they would have to wait until at least 3 September – when Parliament next sits – before they hold it.
In this case, Thursday 19 September would be the earliest possible date to dissolve Parliament.
This would leave Thursday 24 October as a possible election date.
That’s just one week before the UK’s scheduled departure from the EU.
Could the prime minister delay the election date?
The scenarios described by the House of Commons Library assume the prime minister is relatively compliant.
It’s not impossible that a prime minister – determined to leave the EU on 31 October – could try to delay things.
“Even if a vote of no confidence was successful on 3 September, it doesn’t guarantee the election will happen before Brexit day,” says Catherine Haddon, from the Institute for Government think tank.
That’s because the prime minister ultimately controls the timetable.
“For example, they could extend the wash-up [the period where some unfinished Parliamentary business is dealt with] before Parliament is dissolved,” she says.
By doing this, the election could be pushed into November, or beyond.
And by then, the UK would have already left the EU.