Sir Mark Sedwill, the UK’s most senior civil servant, has announced he will stand down in September, prompting anger from former colleagues who say he has been unfairly smeared by Boris Johnson’s aides over the government’s coronavirus failings and for supposedly blocking changes in Whitehall. After weeks of tense negotiations over his job, Sedwill said in a letter to the prime minister that he would quit as cabinet secretary and head of the civil service. His other role as national security adviser will be taken by Johnson’s chief Brexit adviser, David Frost. His departure will be seen as a victory for Dominic Cummings, Johnson’s most senior aide, who has had a tense relationship with Sedwill, and Michael Gove, the cabinet minister who is pushing through a restructuring of government departments. Unnamed Downing Street sources told newspapers in March that Sedwill had failed to get a grip on the coronavirus crisis. Another source was quoted as saying that he had fallen out with Johnson and his aides over the response to Covid-19. In April, Cabinet Office insiders told the Guardian the claims were “shit-stirring” and “absolute crap”. As cabinet secretary, Sedwill was supposed to coordinate the work of permanent secretaries as they grappled with the lockdown, supplies of personal protective equipment, food supplies, prison releases and coronavirus tests. His resignation has been met with anger from former mandarins and comes weeks after other senior civil servants have either left their posts or are set to depart after the Conservatives’ election victory in December. Lord Kerslake, a former head of the civil service, said Sedwill’s departure followed unfair hostile briefings that attempted to blame civil servants for mistakes over coronavirus. “The recent hostile briefing against Sir Mark has been completely unacceptable and undermined a key role in government at a time of great national crisis. “I have great regard for Sir Mark and was responsible for the recruitment process that led to him becoming the permanent secretary at the Home Office. “I fear from some of the press briefing that had obviously gone on that the civil service is being made the fall guy for mistakes made in the handling of the pandemic. This is grossly unfair. We urgently need an independent inquiry to look at the lessons that can be learnt,” he said. Dave Penman, the head of the senior civil servants’ union, the FDA, said: “No 10 – or those around it – has sought to undermine Sir Mark and the leadership of the civil service with a series of anonymous briefings against him over many months. Not only is it a self-defeating and corrosive tactic, it’s also a cowardly one, safe in the knowledge that those who are briefed against are unable to publicly respond. “How would any potential candidate for cabinet secretary judge their prospective employers, given how the current cadre of leaders has been treated by them?” Fiona McLeod Hill, Theresa May’s former joint chief of staff, said: “This is a very sad day for the British government. I worked with Sir Mark closely for a number of years. He is exceptional. He also happens to be a very decent person. I remember how much he looked out for my former partner, Sir Charles Farr, who sadly passed away last year. I will always be grateful to him for that.” The appointment of Frost will also cause controversy, especially among security officials who may well question why a special adviser with no experience of national security has been appointed to the crucial role usually reserved for experienced hands with knowledge of MI6 and MI5. Known as “Frosty” among Johnson’s inner circle of advisers, he will also receive a peerage, it was announced on Sunday. Lord Ricketts, a former national security adviser, said that Frost’s apparent political appointment will radically change a role usually occupied by civil servants. “That completely changes the nature of the role, no longer a politically-neutral civil servant giving dispassionate advice. Plus he is made a peer, so will he be a minister accountable to parliament?” he wrote on Twitter. Sedwill’s exit from No 10 is likely to be part of a wider shake-up of top jobs across the civil service overseen by Cummings and Gove. Sir Philip Rutnam, a former permanent secretary at the Home Office, is suing for unfair dismissal after quitting in February, and Sir Simon McDonald, the permanent secretary at the Foreign Office, is leaving in September following its merger with the Department for International Development. After he leaves government service in September, Sedwill will be made a peer and will chair a panel on global economic security when the UK assumes the presidency of the G7 economic group of nations. He is also expected to take up another security-related role. In an exchange of letters, Sedwill said he had served both Johnson and his predecessor May in “extraordinary times”. “Two years ago, when my predecessor fell ill, your predecessor asked me to step in as cabinet secretary, and you asked me to continue to support you through Brexit and the election period,” he wrote. “It was obviously right to stay on for the acute phase of the Covid-19 crisis. As you are setting out this week, the government’s focus is now shifting to domestic and global recovery and renewal.” Johnson replied that Sedwill had made a “massive contribution” to public life over the past 30 years and had been a source of “shrewd advice”. “You have done it all in Whitehall: from Afghanistan to the modernisation of the civil service; from immigration policy to Brexit and defeating coronavirus,” he said. Sedwill, 55, the cabinet secretary since 2018 and national security adviser since 2017, has told friends he has been angered by negative briefings over many months. Sedwill, who attended cabinet and Cobra meetings, fell ill with the virus soon after Johnson, Prof Chris Whitty, England’s chief medical officer, and Matt Hancock, the health secretary. He informed the cabinet when the prime minister was moved to an intensive care unit. Whitehall officials said several candidates were being mooted to replace him, among them Tim Barrow, the UK’s ambassador to the EU. Occasionally abrupt, Sedwill made enemies in government. The education secretary, Gavin Williamson, was sacked from his previous job as defence secretary after Sedwill led an investigation into a leak from the National Security Council and concluded Williamson was the source. Some senior civil servants have claimed he has failed to back Rutnam in the ongoing row over allegations that the home secretary, Priti Patel, bullied staff. Sedwill was born and grew up in Lincolnshire, attending Bourne grammar school. He studied international economics at the University of St Andrews and has a master’s in economics from St Edmund Hall, Oxford. After joining the Foreign Office in 1989, he had postings in Afghanistan, Egypt, Iraq and Pakistan. Patel said on Sunday that significant Whitehall changes would soon begin. “This is the people’s government, delivering on the people’s priorities, and effectively any reforming government will be based around the type of delivery that our prime minister wants to drive for our great country and obviously have the right kind of support around him to deliver that,” she told Sky News. Gove set out his manifesto for reforming the civil service on Saturday in a lecture titled The Privilege of Public Service. The Cabinet Office minister said the “metropolitan” outlook of decision-makers had contributed to the government becoming “estranged” from the people.