David Cameron dramatically asserted his authority over two warring cabinet ministers on Saturday when he ordered Michael Gove to issue humiliating apologies and told Theresa May to sack her closest adviser, following their public row over policy on combating extremism in schools.

A furious Cameron cracked the whip on the education and home secretaries four days after the two stunned Westminster by abandoning any pretence of cabinet responsibility and went public to voice bitter disagreements over who was to blame for failings on one of the most sensitive issues of government policy.

Following an unusually swift inquiry by the cabinet secretary, Sir Jeremy Heywood, Downing Street issued a statement on Saturday night saying Gove had written to the prime minister and to Charles Farr, the Home Office's security chief whom he had criticised, to apologise for his behaviour. At the same time No 10 said that Fiona Cunningham, May's special adviser at the Home Office and most loyal lieutenant in her four years as home secretary, had resigned her post for negative briefing against the Department for Education. Cunningham is currently in a relationship with Farr. Such action against two top ranking cabinet ministers reflects Cameron's intense irritation at signs that discipline is breaking down at the top of government, and his frustration that their argument may have been fuelled by rivalry over who may replace him as Tory leader if the Conservatives fail to win the next election.

Cameron was also outraged that the two had gone to war on the eve of the Queen's speech last Wednesday, in a way that overshadowed an event designed to showcase the government's legislative programme in the year-long run-in to the next general election.

The row between Gove and May burst into the open after a briefing Gove gave to journalists at the Times was splashed over the paper's front page on Wednesday morning. Gove had told the newspaper over a lunch that he believed the Home Office's failure to combat extremism had allowed a small number of radicals to infiltrate schools in Birmingham, and made clear he blamed Farr and May. When the story was released, the Home Office responded in the middle of the night by tweeting a link to a letter May had written to Gove asking why his department had not done more to combat the problem that it had known about for four years. Cameron, who is planning a cabinet reshuffle possibly as early as this week, is understood to have sought assurances from both ministers that no such arguments will happen again, and told them that if they do he will take a "zero tolerance" approach.

Neither Gove nor May is expected to be moved in the reshuffle but Gove's position is now seen as less secure than it was a few weeks ago. A series of rows between Gove and Nick Clegg over schools policy have also tested the prime minister's patience.

In its statement, Downing Street said: "In relation to unauthorised comments to the media about the government's approach to tackling extremism and the improper release of correspondence between ministers, the prime minister has received the cabinet secretary's review establishing the facts behind these events. In acknowledgement of his role, today, the secretary of state for education has written separately to Charles Farr and the prime minister apologising for the original comments made to the Times newspaper. In addition, in relation to further comments to the Times, Fiona Cunningham has today resigned."

No 10 also said that Gove would make a statement to the House of Commons regarding Ofsted's series of inquiries into Birmingham schools: "The prime minister has made clear that he expects a robust response from all relevant organisations to any findings that confirm that the safety and learning of children in our schools have been put at risk. The prime minister has prioritised fighting all forms of extremism, including through setting up his extremism taskforce in the wake of the horrific killing of Lee Rigby."

As repercussions of the row continued, a coalition of religious leaders and senior politicians is joining forces to defend the option for Muslim parents to send their children to schools which reflect their faith, amid growing concerns over the government's response to the alleged infiltration of Birmingham's schools by Islamic extremists.

The bishop of Birmingham, David Urquhart, together with Labour MPs Liam Byrne and Shabana Mahmood, whose constituents have been embroiled in the controversy, are forming a pan-religious group in response to what they consider increasingly bellicose rhetoric by ministers over the so-called Trojan Horse affair. Their action reflects growing concerns that ministers, in particular Gove, have rushed to judge schools allegedly embroiled in a plot by fundamentalists to infiltrate the education system.

Urquhart said: "Together we can look at the highest standards of governance, excellence in leadership and mutual expressions of faith in schools. It is vital for the cohesion of the whole city that each child in Birmingham has the very best educational experience."

Byrne and others believe that Gove has treated Muslim families as "second-rate" citizens by branding those who seek an education that accommodates their religious views as extreme. The former cabinet minister and leaders of all the major religions in the city will campaign in coming weeks for the city to ensure that "all faiths have access to schools that specialise in raising children in different religions".

In a first move, he wants parents with children at Park View academy, the secondary school at the centre of the affair, to be consulted on whether it becomes a designated faith school. There is currently only one Islamic faith school in Birmingham, which has more than 140,000 Muslims.

Last week ministers, including the chancellor George Osborne, said that there was a problem of extremism in Birmingham's schools. The findings of Ofsted's inquiries into the question will be published on Monday. Gove will make a statement to the Commons on the findings. Yet leaked sections of the Ofsted report referring to Park View academy, judged outstanding just two years ago, suggest that inspectors did not find any evidence of extremism in the school or a policy of segregation, as had been initially claimed.

The schools inspectorate instead judged the school, which is expected to be put into special measures next week, as inadequate for failing to adequately warn its pupils about extremism. Staff were also said to have not received enough training in the government's anti-extremism Prevent programme.

Speaking to the Observer, the school's assistant principal, Lee Donaghy, said he believed the Ofsted inspectors "made sure they got the answers they wanted having been, in our view, sent in to put the school into special measures".

Byrne, a Catholic, said he would not comment on the Ofsted report until it was published but said that many people in Birmingham saw parallels in the treatment of the Muslim community to the discrimination meted out to the Irish Catholic diaspora after the IRA bombed the city.

"Muslim parents do not enjoy the same freedom as Catholic parents now to have their children educated in schools focused on their faith and that is one of the most basic freedoms we enjoy in this country," Byrne said.

"I think faith leaders will support us in our call to act together to make sure parents of all faiths have access to schools that specialise in raising children in different religions. That is not the case at the moment. That is not good and it is not right. As British citizens we should all think that is wrong."

Shadow education secretary Tristram Hunt on Saturday demanded answers about what Gove knew about the claims of extremism following reports that concerns were raised with his department as far back as 2010.

Speaking to the Observer, Salma Yaqoob, the former leader of Respect and a councillor in Birmingham until 2011, said that a generation in her city would be blighted by the row. A public meeting to protest against what she described as a "witch-hunt" is being organised for the end of this month.

Yaqoob said: "Park View was judged outstanding in 2012. Which Ofsted report are we supposed to believe? Either they are incompetent or politically directed."

Meanwhile, further evidence has emerged of the tensions between Gove and May. The Observer has seen documents drawn up last February showing the DfE considered a 25% cut to its counter-extremism efforts – but that Gove stopped the move due to his personal concerns over the Home Office's ability to deal with the issue. Advisers warned him that cutting spending on counter-extremism would mean "we would have to rely on the Home Office to ensure that projects they approve are appropriate and fit with DfE policy priorities".