Boris Johnson leaves Downing Street having narrowly managed to clock up more days in the job than his immediate predecessor, Theresa May.

When Mr Johnson’s premiership comes to an end on September 6, it will have lasted three years and 44 days – slightly longer than that of Mrs May, who was in office for three years and 11 days between 2016 and 2019.

He has also just managed to beat one of his Labour predecessors, Jim Callaghan, who was prime minister for three years and 29 days from 1976 to 1979.

In total, Mr Johnson has outrun eight of the 22 other people who have served as UK prime minister since 1900.

(PA Graphics)

Along with Mr Callaghan and Mrs May, these include Gordon Brown, who lasted two years and 318 days as Labour PM from 2007 to 2010, and Anthony Eden, who managed one year and 279 days as Conservative PM between 1955 and 1957.

The prime minister with the shortest time in office since 1900 is the Conservative politician Andrew Bonar Law, who clocked up just 211 days from 1922 to 1923 before resigning due to ill health.

Margaret Thatcher currently holds the record for the longest premiership since 1900, managing 11 years and 208 days as Conservative PM from 1979 to 1990.

Tony Blair is in second place, with 10 years and 56 days as Labour PM from 1997 to 2007.

Whoever replaces Boris Johnson as prime minister on September 6 will have only 870 days before the last possible date of the next general election, on January 23 2025.

If that person is then defeated at the election, they will go down in history as the fifth shortest serving PM since 1900, finishing behind Gordon Brown but just ahead of the Liberal politician Henry Campbell-Bannerman, whose tenure lasted two years and 122 days from 1905 to 1908.