Prime minister proves longstanding friendships or policies he approves of will not save ministers from the axe in reshufffle

Michael Gove has been demoted from his dream post as a radical education secretary to a lower role of chief whip, as David Cameron attempts to neutralise the Tories' increasingly toxic relations with the teaching profession.

In another dramatic sign of the prime minister's determination to reshape his government – and present a fresh face to voters before the election – Gove will lose his full cabinet seat, as the mild-mannered women's minister, Nicky Morgan, replaces him. Morgan will continue as women's minister and take up the equalities brief as well.

Meanwhile, Liz Truss, the comprehensive-educated policy wonk who grew up in Leeds, will succeed Owen Paterson as environment secretary, as Cameron carries out his long-awaited plan to promote women to senior posts.

The PM, who has grown increasingly frustrated with Gove in recent months after he confronted fellow cabinet ministers in public, softened the blow of his demotion by saying that Gove would have an important role promoting Tories in the media. Cameron tweeted: "Michael Gove is Commons chief whip. He'll have an enhanced role in campaigning and doing broadcast media interviews."

The demotion for Gove, who will now take up his post rallying Tory MPs in parliament, in a job in which his predecessor had a non-voting cabinet seat, was the biggest surprise as the prime minister embarked on the second stage of his most wide-ranging reshuffle since the election, which saw the cull of a series of middle-aged men.

The PM confirmed that the Eurosceptic Philip Hammond will move from the Ministry of Defence to succeed William Hague as foreign secretary. Friends of Hammond, who said last year that he would vote to leave the EU if Britain did not change its membership terms, briefed the Spectator magazine that he would speak out on Europe.

The promotion of Hammond, following the sacking of Dominic Grieve as attorney general, came amid suggestions that Cameron is prepared to offer a tough line on Britain's future commitment to the European convention on human rights in the Tory manifesto. Grieve, a fluent French speaker, had been highly sceptical of questioning Britain's membership of the Council of Europe, the pan-European human rights watchdog that underpins the ECHR. Michael Fallon, the troubleshooting business minister, is promoted to the cabinet to replace Hammond as defence secretary.

The demotion of Gove shows that the prime minister will spare nobody – not even close friends – as he removes obstacles to securing a Tory majority at next year's general election. Cameron, who is wholly supportive of Gove's creation of a new generation of free schools, has been advised that the party risks losing significant support after relations between his departing education secretary and teachers became badly poisoned.

Nicky Morgan leaves Downing Street after her appointment as education secretary. Photograph: Suzanne Plunkett/Reuters

Cameron, who is still a close friend of Gove's, became exasperated with his confrontational approach to fellow ministers. Cameron was furious when Gove briefed against the Home Office counter-terrorism chief Charles Farr at a recent lunch with the Times, sparking a row with Theresa May, which led to the resignation of her special adviser.

No 10 has also become increasingly frustrated with the aggressive blogging of Dominic Cummings, Gove's former special adviser, who played a key role in drawing up his free schools programme. No 10 will hope that Gove's demotion will make the interventions by Cummings less potent.

Greg Clark, the cities minister, will replace David Willetts as universities and science minister with a non-voting cabinet seat. The prime minister tweeted: "Greg Clark is Minister for Science and Universities and Minister of State at the Cabinet Office. He will attend all Cabinets."

Esther McVey remains as employment minister. But she will also attend cabinet.

Government sources insisted the reshuffle is not all about promoting women – but an effort to redress the lack of women at the top of the government is bound to be a central theme of the day. Truss has worked alongside Gove for a while, and is one of the most articulate and sure-footed of the new intake.

Hague is to take on the lesser role of leader of the House of Commons, while in a far wider than expected cull of male ministers, the former chancellor Kenneth Clarke will leave the government, along with Damian Green, the policing minister, and David Willetts, the universities and science minister.

As shellshocked former ministers walked the corridors of Westminster on Monday night, there were the first signs of a backlash as the scale of the cull of middle-aged men became clear. "It's the night of the long knives and that went really well last time," one Tory said sarcastically, referring to Harold Macmillan's desperate attempt to shore up his government in 1962, when he sacked a third of his cabinet.

Hague will take on his new role before he stands down as MP for Richmond at the election, to allow him to focus on his writing career. The PM praised the outgoing foreign secretary as "one of the leading lights of the Conservative party for a generation".

Hague's move has echoes of the path taken by Robin Cook after the 2001 election. But that was a clear demotion, unlike Hague whose decision to stand down at the election paved the way for a less onerous cabinet post.

As expected Sir George Young, the chief whip, and David Jones, the Wales secretary, were sacked from the cabinet. A significant reshaping of Whitehall was also signalled as it became clear that Sir Bob Kerslake, the head of the home civil service, who had clashed with the Cabinet Office minister Francis Maude, will retire next spring. Kerslake turns 60 in February, the usual retirement date for senior civil servants.