Boris Johnson has carried out a massive cabinet clear-out as he set to working building a government dominated by Brexit loyalists.

Within hours of the new prime minister taking over from Theresa May, 13 full cabinet ministers and four others who attended cabinet were sacked or resigned from the government in a bloodbath which far outstripped the 1962 Night of the Long Knives

The incoming prime minister installed Brexit true believers Priti Patel as home secretary and Dominic Raab as foreign secretary and de facto deputy prime minister. Stephen Barclay remained as Brexit secretary, Liz Truss became international trade secretary and Andrea Leadsom business secretary while Theresa Villiers returned to government as environment secretary.

Michael Gove, who was a Vote Leave figurehead alongside Mr Johnson in the 2016 referendum campaign but famously sabotaged his later campaign for the leadership, became Chancellor of the Duchy of Lancaster, where he will take responsibility for leading preparations for a possible no-deal Brexit in October.

Boris Johnson’s cabinet Chancellor - Sajid Javid - replaces Philip Hammond Home Secretary – Priti Patel – replaces Sajid Javid Foreign Secretary – Dominic Raab – replaces Jeremy Hunt Brexit Secretary - Stephen Barclay - no change Chancellor of the Duchy of Lancaster - Michael Gove - replaces David Lidington Defence Secretary - Ben Wallace - replaces Penny Mordaunt International Trade Secretary - Liz Truss - replaces Liam Fox Health Secretary - Matt Hancock - no change Environment Secretary - Theresa Villiers - replaces Michael Gove Education Secretary - Gavin Williamson - replaces Damian Hinds Culture Secretary - Nicky Morgan - replaces Jeremy Wright Business Secretary - Andrea Leadsom - replaces Greg Clark Housing and Communities Secretary - Robert Jenrick - replaces James Brokenshire Works and Pensions Secretary - Amber Rudd - no change (also takes Women and Equalities brief) Justice Secretary - Robert Buckland - replaces David Gauke International Development Secretary - Alok Sharma - replaces Rory Stewart Transport Secretary - Grant Shapps - replaces Chris Grayling Welsh Secretary - Alun Cairns - no change Scottish Secretary - Alister Jack - replaces David Mundell Northern Ireland Secretary - Julian Smith - replaces Karen Bradley Leader of Lords - Baroness Evans - no change Leader of Commons - Jacob Rees-Mogg - replaces Andrea Leadsom Conservative Party chairman - James Cleverly - replaces Brandon Lewis

New chancellor of the exchequer Sajid Javid was the only holder of a great office of state to have backed Remain in the referendum. He was also the first Muslim to lead the Treasury. Former Remainer Matt Hancock stayed on as health secretary and Nicky Morgan – who backed Remain in the referendum but was later an author of the Malthouse Compromise attempt to solve the Irish backstop problem – was appointed culture secretary.

Less than three months after being sacked as defence secretary for leaking secrets, Gavin Williamson returned to the cabinet as education secretary following his key role in Mr Johnson’s leadership bid.

Jeremy Hunt, Mr Johnson’s rival in the Tory leadership contest, walked out of the government after being offered a demotion from foreign secretary. He refused to take the defence secretary post of Penny Mordaunt, who was sacked after less than three months in the role.

Instead, one of Mr Johnson’s oldest and closest parliamentary allies, Ben Wallace – head of his abortive 2016 campaign for the leadership – was eventually appointed defence secretary in her place.

There was a clear-out of many of Ms May’s old guard, with Liam Fox, the international trade secretary and Greg Clark, the business secretary, all leaving their roles, along with Damian Hinds, the education secretary, and James Brokenshire, the housing and communities secretary.

David Mundell, the Scotland secretary, and Karen Bradley, the Northern Ireland secretary, were also sacked by Mr Johnson, as were Jeremy Wright, the culture secretary, Mel Stride, the Commons leader, and Caroline Nokes, the immigration minister.

Sources said Chris Grayling, the transport secretary, had resigned.

Four other ministers – Philip Hammond, the chancellor, David Lidington, the deputy prime minister, David Gauke, the justice secretary, and Rory Stewart, the international development – quit earlier on Wednesday after saying they would not serve under Mr Johnson.

Julian Smith, the chief whip, was replaced earlier in the week by Mark Spencer.

Mr Hunt wrote on Twitter: “I would have been honoured to carry on my work at the Foreign and Commonwealth Office but understand the need for a new PM to choose his team. [Boris Johnson] kindly offered me another role but after 9 years in cabinet and over 300 cabinet meetings now is the time to return to [the] backbenches from where [the] PM will have my full support.”

Boris Johnson's cabinet: Who's in and who's out Show all 40 1 /40 Boris Johnson's cabinet: Who's in and who's out Boris Johnson's cabinet: Who's in and who's out In: Jacob Rees-Mogg Jacob Rees Mogg appointed Leader of the Commons AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Esther McVey Esther McVey appointed housing secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Jo Johnson Jo Johnson appointed new business and energy secretary EPA Boris Johnson's cabinet: Who's in and who's out In: Brandon Lewis Brandon Lewis appointed immigration secretary Getty Boris Johnson's cabinet: Who's in and who's out In: James Cleverly James Cleverly appointed Conservative Party chairman PA Boris Johnson's cabinet: Who's in and who's out In: Baroness Evans Baroness Evans remains Leader of Lords PA Boris Johnson's cabinet: Who's in and who's out In: Julian Smith Julian Smith appointed Northern Irish secretary Reuters Boris Johnson's cabinet: Who's in and who's out In: Alister Jack Alister jack appointed Scottish secretary PA Boris Johnson's cabinet: Who's in and who's out In: Alun Cairns Alun Cairns remains Welsh secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Grant Shapps Grant Shapps appointed transport secretary Getty Boris Johnson's cabinet: Who's in and who's out In: Alok Sharma Alok Sharma appointed international development secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Robert Buckland Robert Buckland appointed justice secretary Getty Boris Johnson's cabinet: Who's in and who's out In: Amber Rudd Amber Rudd remains work and pensions secretary Getty Boris Johnson's cabinet: Who's in and who's out In: Robert Jenrick Robert Jenrick appointed housing and communities secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Andrea Leadsom Andrea Leadsom appointed business secretary Reuters Boris Johnson's cabinet: Who's in and who's out In: Nicky Morgan Nicky Morgan appointed culture secretary Getty Boris Johnson's cabinet: Who's in and who's out In: Gavin Williamson Gavin Williamson appointed education secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Theresa Villiers Theresa Villiers appointed environment secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Liz Truss Liz Truss is appointed international trade secretary Reuters Boris Johnson's cabinet: Who's in and who's out In: Ben Wallace Ben Wallace appointed defence secretary EPA Boris Johnson's cabinet: Who's in and who's out In: Stephen Barclay Stephen Barclay remains EU secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Dominic Raab Dominic Raab appointed foreign secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Priti Patel Priti Patel appointed home secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Michael Gove Michael Gove given Chandellor of the Duchy of Lancaster AFP Boris Johnson's cabinet: Who's in and who's out In: Sajid Javid Sajid Javid is appointed Chancellor of the Exchequer AP Boris Johnson's cabinet: Who's in and who's out Out: Jeremy Hunt Jeremy Hunt sacked as foreign secretary Reuters Boris Johnson's cabinet: Who's in and who's out In: Matt Hancock Matt Hancock remains health secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out Out: Chris Grayling Chris Grayling resigned as transport secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: Jeremy Wright Jeremy Wright sacked as culture secretary PA Boris Johnson's cabinet: Who's in and who's out Out: Karen Bradley Karen Bradley sacked as Northern Ireland secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: James Brokenshire James Brokenshire sacked as housing and communities secretary Reuters Boris Johnson's cabinet: Who's in and who's out Out: Penny Mordaunt Penny Mourdaunt sacked as defence secretary Reuters Boris Johnson's cabinet: Who's in and who's out Out: Liam Fox Liam Fox sacked as international trade secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: Greg Clarke Greg Clarke sacked as business secretary PA Boris Johnson's cabinet: Who's in and who's out Out: David Mundell David Mundell sacked as Scottish secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: Damien Hinds Damien Hinds sacked as education secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: David Gauke David Gauke resigned as justice secretary EPA Boris Johnson's cabinet: Who's in and who's out Out: Rory Stewart Rory Stewart resigned as international development secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: David Lidlington David Lidlington resigned as deputy Prime Minister PA Boris Johnson's cabinet: Who's in and who's out Out: Philip Hammond Philip Hammond resigned as Chancellor of the Exchequer AFP/Getty

Ms Mordaunt, who backed Leave in the 2016 referendum, had been widely expected to continue in Mr Johnson’s top team but announced that she would be leaving her role.

She tweeted: “I’m heading to the backbenches from where the PM will have my full support, as will my successors.

“Thank you to everyone who’s helped me get things done, especially our Armed Forces and civilians in defence for the last 85 days. We achieved much.”

Mr Fox, who has served as international trade secretary since Theresa May took office in 2016, wrote on Twitter: “I look forward to supporting Boris Johnson and the government from the backbenches.”

Labour Party chair Ian Lavery said: “Boris Johnson’s first act as Prime Minister has been to appoint a cabinet of hardline conservatives who will only represent the privileged few.

“A chancellor who’s consistently called for more tax cuts for big corporations, home and education secretaries who were sacked for breaches of national security and a foreign secretary who doesn’t know the importance of our ports.

“This out-of-touch cabinet pushed for nine years of damaging austerity, while demanding tax cuts for the super-rich and big corporations.