The UK's top official during the first part of the Covid pandemic has said he urged Boris Johnson to remove Matt Hancock as health secretary.
Lord Sedwill, who was cabinet secretary until the autumn of 2020, agreed he left the then-prime minster "under no doubt" he should be replaced.
He raised his concerns with Mr Johnson privately in the summer of that year, he told the Covid inquiry.
A loss of confidence in him had been damaging the Covid response, he added.
WhatsApp messages heard at the inquiry also laid bare the tensions at the top of government between civil servants and ministers.
They are the latest revelations from the inquiry, which is currently investigating the political response during the pandemic.
Lord Sedwill was the UK's top civil servant until he was replaced in the role by Simon Case in September 2020, amid tensions between him and senior members of Mr Johnson's team.
In one exchange between the two officials in June 2020, Mr Case, who at the time was permanent secretary at No 10, compared working in the Johnson government to "taming wild animals".
Mr Case added that unnamed advisers to the former prime minister were "basically feral".
"I have the bite marks," Lord Sedwill replied.
In another exchange between the two men, he writes: "Hancock is so far up [Mr Johnson's] arse his ankles are brown."
In further WhatsApp messages shown to the inquiry, Lord Sedwill appears to describe Mr Hancock as "totally incompetent" over his remarks on Dominic Cummings's controversial trip to Barnard Castle in the spring of that year.
He added that the "idiocy" of Mr Hancock's response, as well as then-attorney general Suella Braverman, risked undermining Covid laws, adding: "I'm ready to read the riot act as required."
Speaking at the inquiry, Lord Sedwill admitted he told Mr Case in another exchange that Mr Hancock should be sacked "to save lives and the NHS".
He said this was "gallows humour" echoing the government's own pandemic slogan of the time - but acknowledged this was "inappropriate, even in a private exchange".
Lord Sedwill told the inquiry he held a private conversation with Mr Johnson, where he did not use the word "sack" but discussed whether Mr Hancock "was the right person to lead the next phase".
Asked whether Mr Johnson was left in "no doubt whatsoever" he should replace Mr Hancock, Lord Sedwill replied: "Indeed".
The inquiry's lawyer said that in his own witness statement, Mr Johnson had recalled he did not think he had received any advice from Lord Sedwill that Mr Hancock should be removed.
"I can see how he might remember it way. I did not provide formal advice to the prime minister," Lord Sedwill replied.
Elsewhere in his evidence, Lord Sedwill apologised for suggesting, in the early phase of the pandemic, that people could hold "chickenpox parties" to boost their immunity to Covid.
In the UK where chickenpox vaccines are not routinely given, parents have been known to hold parties to help to expose children to the contagious infection in order for them to become immune in later life.
He told the inquiry he had made the remarks in "private exchanges" that he never thought would be made public.
But he added that "the interpretation that has been put on it" made him come across as "both heartless and thoughtless".
"I do understand the distress that must have caused and I apologise for that," he added.
He added that he had used it as an "analogy" for the government's policy at the time, to shield vulnerable people from the virus whilst allowing it to spread among lower-risk groups.
"I should say, at no point did I believe that coronavirus was only of the same seriousness as chickenpox. I knew it was a much more serious disease, that was not the point I was trying to make."
The inquiry is taking witness evidence in London until Christmas, before moving to Scotland, Wales and Northern Ireland.
Mr Hancock is expected to give evidence later this autumn. Mr Case is currently on medical leave from the civil service.