By the early hours of Friday morning, the election outcome will have become clear. While the pollsters indicate a narrow overall majority for the Conservatives, all are agreed this is the most complex and unpredictable general election in living memory. Another hung parliament is a distinct possibility.
So what are the rules on who governs if no single party commands a majority in the Commons? The outcome will depend on the precise arithmetic across the parties, and which minor parties are willing to collaborate with the Conservatives or Labour.
It is clearly established as a matter of constitutional practice that the incumbent Prime Minister, Boris Johnson, possesses the initiative and first opportunity to try to negotiate a confidence and supply agreement, or less likely a coalition, with the minor parties.
Convention also dictates that he will remain in office during the inter-party talks.
If he fails, then Jeremy Corbyn, as the leader of the opposition – the next largest party in the Commons – has the right to be appointed Prime Minister.
It is conceivable, if unlikely, that protracted negotiations between Labour and the minor parties could lead to the opposition leader resigning, or being replaced in favour of another parliamentarian in order to secure majority cross-party support in the Commons and the formation of a new government.
The tenure of the Prime Minister after the election, whether this is Johnson or Corbyn, will be tested at the meeting of the new parliament in the debates on the Humble Address to the Queen, in response to the new government’s first Queen’s Speech.
This could include a situation where the incumbent Prime Minister, Johnson, simply refused to resign, even though it is apparent he cannot command the confidence of the Commons.
In constitutional practice a defeat for the government on the Address is a resignation issue, of similar effect to that of a no confidence resolution prior to the Fixed-term Parliaments Act 2011.
In 1923 Stanley Baldwin resigned in such a situation, allowing the opposition leader Ramsay MacDonald to be appointed premier.
Boris Johnson could win the election for his party but lose his own parliamentary seat, which in 2017 he won by only 5,000 votes, the narrowest margin any previous prime minister has held since 1924.
It is a convention, not a statutory requirement, that an essential qualification for holding office as Prime Minister is possession of a seat in the Commons.
Given the declining robustness of conventions and the greater role of public opinion in determining their force, Johnson might refuse to resign, and wait for a backbench MP in a safe seat to volunteer to resign, enabling him to fight a by-election.
In the meantime, a reliable Cabinet minister could deputise and cover the Prime Minister’s parliamentary business. Whether this action succeeds would depend on pressures of opinion in parliament and the country.
Finally, it is now established practice that where matters of the exercise of the royal prerogatives arise, notably in the legal appointment or dismissal of a Prime Minister, no personal discretion to choose between the parties will be exercised by the Queen.
Where the Prime Minister’s advice is constitutionally suspect or inapplicable, most likely because it relates to the Prime Minister’s own position, the dispute can be resolved by a vote in the House of Commons by way of a motion or Humble Address to guide the actions of the Queen.
By Robert Blackburn QC LLD is Professor of Constitutional Law, King’s College London.