Labour has accused Theresa May of breaking the ministerial code after David Cameron took dramatic action to assert his authority over two feuding cabinet ministers in the row over allegations of Muslim extremism in Birmingham schools.

Yvette Cooper, the shadow home secretary, said on Sunday that May needed to explain to explain her conduct in the row that led to Downing Street announcing late on Saturday afternoon that Michael Gove, the education secretary,had written two letters of apology and that one of May's special advisers was resigning.

The prime minister was hoping to close down a battle that started when Gove gave a private briefing to the Times criticising the way May and her security and counter-terrorism chief, Charles Farr, were tackling extremism. May's adviser, Fiona Cunningham, retaliated by briefing against Gove, and a private letter from May to cabinet colleagues critical of Gove's record tackling extremism in schools was posted on the Home Office's website.

Gove has written letters of apology to Cameron and to Farr and Cunningham, who is in a relationship with Farr, has resigned, No 10 said on Saturday.

But Cooper said that May herself had to explain her role in the affair. It is assumed that she authorised Cunningham's counter-briefing, and the release of the letter, but this has not been confirmed.

Speaking on BBC1's Andrew Marr show on Sunday, Cooper said May seemed to have broken the ministerial code of conduct..

"I think Theresa May needs to come out publicly and answer what she did to publish this letter," Cooper said. "In the ministerial code it says that ministerial correspondence in cabinet committees shouldn't be published, it should be private. They didn't just leak it, they published it on the Home Office website and it was up there for many days. [May] presumably must have authorised that. Why has she not apologised?"

Cooper also claimed that she had never seen such a public row between cabinet colleagues on a matter with implications for national security.

In an interview on the same programme, William Hague, the foreign secretary, said the affair showed Cameron behaving as "a good prime minister making sure there is team discipline in the government".

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, is understood to have sought assurances from both ministers that no such arguments would 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 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 Gove would make a statement to the House of Commons on Monday 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."