Rishi Sunak has won his seat in the Richmond and Northallerton constituency, avoiding becoming the first sitting Prime Minister to lose his seat.

Mr Sunak, who was previously MP for Richmond, has become the new MP for Richmond and Northallerton after changes to the constituency boundary.

He collected 23,059 votes, winning the seat with a majority of more than 12,000.

At the 2019 election, Mr Sunak won with a majority of 27,000.

Has a Prime Minister ever lost their seat in a UK election?

According to the Institute for Government website, no incumbent (currently holding office) prime minister has ever lost his or her seat at a general election.

There have been Prime Ministers who have won with relatively small majorities though, such as Boris Johnson in 2019 who won by 7,210 votes in the Uxbridge and South Ruislip seat.

The Institute for Government adds: "Two prime ministers have come close to losing their seats. In December 1905, Arthur Balfour resigned as prime minister in an attempt to force an election, but the leader of the opposition, Henry Campbell-Bannerman, instead formed a government and became PM. Balfour went on to lose his constituency at the election a month later.

"In the 1935 general election, Ramsay MacDonald was defeated, having resigned as head of the national government not long before the campaign started." 

Obviously, there have been plenty of cases where the current Prime Minister has won their seat but their party has lost overall.

This meant they could remain as an MP in Parliament, whilst most likely resigning from the leadership position of their party.

What would happen if a Prime Minister lost their seat but their party won?

There is no precedent for this situation occurring so it is difficult to say what would happen in this scenario.

The Cabinet Manual says that a Prime Minister "will normally be the accepted leader of a political party that commands the majority of the House of Commons", but it does not say that this must be the case.

Recommended reading:

The Institute for Government states: "However, prime ministers are expected to be accountable to parliament through Prime Minister’s Questions, delivering statements and appearing in front of the Liaison Committee.

"It would therefore not be sustainable for a prime minister to stay in office without being an MP indefinitely."

The most likely thing that would happen is that the Prime Minister would resign, a Cabinet minister of deputy leader would be made an interim PM and then a leadership contest would take place within the party to appoint a new one.