Sayeeda Warsi, the senior Foreign Office minister, has resigned from the government in protest at its policy on Gaza, describing it as “morally indefensible”.

Lady Warsi announced her departure on Twitter on Tuesday, saying: “With deep regret I have this morning written to the Prime Minister & tendered my resignation. I can no longer support Govt policy on #Gaza.”

In her resignation letter, Warsi said the government’s “approach and language during the current crisis in Gaza is morally indefensible, is not in Britain’s national interest and will have a long term detrimental impact on our reputation internationally and domestically”.

She said the UK’s stance was “not consistent with the rule of law and our long support for international justice”, adding: “The British government can only play a constructive role in solving the Middle East crisis if it is an honest broker and at the moment I do not think it is.”

Sayeeda Warsi (@SayeedaWarsi) With deep regret I have this morning written to the Prime Minister & tendered my resignation. I can no longer support Govt policy on #Gaza

The chancellor, George Osborne, hit back immediately, saying her decision was unnecessary and insisting that ministers were committed to working to secure peace in the region. “This a disappointing and frankly unnecessary decision,” he said. “The British government is working with others in the world to bring peace to Gaza and we do now have a tentative ceasefire which we all hope will hold.”

David Cameron was more emollient, writing in his reply to Warsi’s letter that he realised “this must not have been an easy decision for you to make”, and adding: “I understand your strength of feeling on the current crisis in the Middle East – the situation in Gaza is intolerable.”

The prime minister said the government’s position on Israel and the Palestinians was clear: “Our policy has always been consistently clear: we support a negotiated two-state solution as the only way to resolve this conflict once and for all and to allow Israelis and Palestinians to live safely in peace. “Of course, we believe that Israel has the right to defend itself. But we have consistently made clear our grave concerns about the heavy toll of civilian casualties and have called on Israel to exercise restraint, and to find ways to bring this fighting to an end. As part of that, we have consistently called for an immediate and unconditional humanitarian ceasefire.”

Ed Miliband said Warsi had acted with “principle and integrity” and he urged Cameron to re-think his position. “I hope that David Cameron will reflect on what she says in her resignation letter and change his approach,” he told BBC News. “He needs to break his silence and say that Israel’s actions have been unjustified and indefensible. He needs to show that he can be even-handed and, without fear or favour, argue for the long-term solution that we need to this tragic conflict.”

In an interview with the Huffington Post, Warsi said: “Our position not to recognise Palestinian statehood at the UN in November 2012 placed us on the wrong side of history and is something I deeply regret not speaking out against at the time.”

The Tory peer said that, having now stood down, she wanted to “speak more freely” on the issue and her first demand after handing in her resignation letter was for the UK to introduce an arms embargo against Israel. “It appals me that the British government continues to allow the sale of weapons to a country, Israel, that has killed almost 2,000 people, including hundreds of kids, in the past four weeks alone. The arms exports to Israel must stop.”

In a further interview with Channel 4 News, Warsi suggested Cameron had been “mealy-mouthed” over his refusal to say Israel’s actions had been disproportionate.

“I think for me, it’s morally indefensible where after four weeks of a conflict – more than a quarter of the Gazan population displaced, nearly 2,000 people killed, nearly 400 innocent children killed – we still cannot find the words to say we condemn this and we feel this action has been disproportionate. These issues are far too serious for us to have been mealy-mouthed and for us to be dragging our heels.”

Warsi was known to have been unhappy with Cameron’s failure to unequivocally condemn Israel’s incursion into Gaza or the mounting death toll. On Monday, the prime minister’s spokesman refused to say if Israel was behaving disproportionately or doing enough to prevent civilian casualties. Warsi has been increasingly critical of Israel’s behaviour. She recently tweeted: “Can people stop trying to justify the killing of children. Whatever our politics there can never be justification, surely only regret.”

Following criticism about the timing of her resignation – on the 29th day of the conflict and after a ceasefire had been announced – Warsi spoke to the BBC to say: “Over the last four weeks, I have done everything that I can both at formal meetings and informal meetings trying to convince my colleagues that our current policy on Gaza is morally indefensible, that it’s not in our interests, it’s not in British interests and that it will have consequences for us both internationally and here at home.

“In the end, for us I felt the government’s position was not moving and therefore I had to on a point of principle resign.”

Warsi became the first Muslim to sit in the cabinet when she was made Conservative party co-chair by Cameron after the 2010 general election. She was subsequently moved to the post of minister of state at the Foreign Office and minister for faith and communities in the prime minister’s 2012 reshuffle – a move widely regarded as a demotion.

Cameron is due to fly to Portugal on Tuesday morning to rejoin his family on holiday after attending first world war commemorations in the UK, France and Belgium.

There was a high-level campaign to remove Warsi before last month’s reshuffle, particularly after she appeared on ITV’s The Agenda and posed with a mock front page about the “Eton Mess” at the top of the government. Warsi is known to be keeping a diary and there have been fears she will publish it before the election in an effort to expose the upper-class coterie in Cameron’s inner circle.

Her resignation also threatened to reveal disagreement within the Tory party over Israel. The London mayor, Boris Johnson, responded to Warsi’s resignation by saying it was very sad when any government minister stood down. “I think she will be back as soon as possible. My view as mayor of London is that it is not the function of the mayor to get deeply embroiled in this,” he said on LBC radio’s Ask Boris phone-in.

He added that events in Gaza were “utterly horrifying and unacceptable”, but said “there is no point in politicians getting in a bidding war about issuing the most frenzied denunciation of what is going on”. Referring to the Israeli bombing, Johnson said: “I cannot for the life of me see why this is a sensible strategy. It is not my function to arbitrate or adjudicate in this matter – I am a passionate supporter of Israel. I cannot for the life of me see the purpose of this. It is disproportionate, ugly and tragic and will not do Israel any good in the long run.”

Nick Clegg said it was “no secret there are differences of opinions and emphases” in the government in relation to Gaza. Speaking at an event on immigration, he said: “Sayeeda Warsi clearly feels very strongly about this and has explained it to the prime minister in her own words. I believe it is right for Britain to be unambiguous in our condemnation of Hamas’s indiscriminate firing of rockets but also very forceful and outspoken about Israel. The bombing of three UN schools is a complete outrage.”

Asked whether Cameron had been critical enough of Israel’s actions, Clegg said it was up to the prime minister to speak for himself. “Clearly the prime minister and I take different views on this and we always have done.”

Clegg made it clear he would not be following Warsi and resigning over the issue, saying he agreed with government’s position in favour of “peace rather than conflict and a ceasefire rather than violence”.