Nearly two years after leading the Labour Party to a landslide election victory, Prime Minister Keir Starmer has announced his resignation amid a mounting rebellion within the party, kick-starting the race for the seventh prime minister of the United Kingdom in 10 years.

In an emotional address on Monday, Starmer said he would remain in office until a new Labour leader and, by extension, the next prime minister is selected. The formal leadership contest is to begin on July 9 and is to be completed by the UK Parliament’s summer recess.

Weeks of internal pressure after disappointing local election results had already weakened Starmer’s position. A decisive parliamentary by-election victory in Makerfield by challenger and Greater Manchester Mayor Andy Burnham ultimately triggered the resignation.

Since 2016, the UK has had six prime ministers, averaging one every one and a half to two years, compared with the much longer tenures of Margaret Thatcher and Tony Blair, who each led the country for more than a decade.

The graphic below shows the 10 prime ministers the UK has had over the past 50 years.

The longest-serving UK prime minister in history was Robert Walpole, who held office for more than two decades from 1721 to 1742. In recent times, Thatcher served a little more than 11 years from 1979 to 1990 while Blair was prime minister for 10 years from 1997 to 2007.

At the other end of the scale, Truss holds the record for the shortest premiership in British history, lasting just 49 days in 2022.

Burnham’s return to the House of Commons has instantly placed him as the frontrunner to succeed Starmer although other Labour leaders, such as former Health Secretary Wes Streeting, are expected to also consider a run.

A candidate requires the nominations of 81 Labour MPs to make the ballot, which could either trigger a full summer campaign or a swift, uncontested handover if a backroom deal is struck.