Cabinet Secretary Simon Case has announced he will step down by the end of the year on health grounds.
The top civil servant had been undergoing medical treatment for a “neurological condition” over the last 18 months.
In a statement he said “whilst the spirit remains willing, the body is not,” adding that the decision is “solely to do with health and nothing to do with anything else.”
A recruitment process for the next cabinet secretary has begun.
His role is already being advertised on the Civil Service website, with a salary of £200,000.
Mr Case, 45, told Sir Keir Starmer on Monday morning about his decision.
He has been in the role since September 2020 under Boris Johnson and is now serving his fourth prime minister.
In his letter announcing his resignation, he said it had “been an honour to serve two sovereigns, four prime ministers and over 120 Cabinet ministers in this role”.
He went on to say “the world is changing fast and so must the Civil Service”.
He has at times been a controversial figure, facing scrutiny over his role in the Downing Street Partygate scandal and over messages he exchanged with ministers during the pandemic.
More recently there have been reports of tensions at the heart of No 10 between Mr Case and the prime minister’s chief of staff, Sue Gray.
And in a letter leaked earlier this month, Mr Case said the previous Conservative government’s failure to hold a spending review in its final years in office had contributed to uncertainty over the public finances.
He denied allegations by the Conservatives that the new government’s claims to have inherited an economic “black hole” were bringing the civil service into “disrepute”.
In October last year, Mr Case announced he was taking time off because of a private medical matter, and he was widely expected to leave the civil service in the coming months.
A Cambridge graduate with a PhD in political history, Mr Case ascended through the ranks of the civil service after joining in 2006.
He held roles in the UK’s intelligence agency, GCHQ, and in the Royal Household on the way to the top job.
At the age of 41, he became the youngest cabinet secretary in more than 100 years.
The cabinet secretary is the most senior civil servant and involves advising the prime minister, leading implementation of the government’s policies and managing other high-level civil servants.