Labour has sacked three junior shadow ministers who joined with Jeremy Corbyn and 14 other Socialist Campaign group MPs in breaking the party’s whip by voting against the second reading of a controversial armed forces bill. Sources close to the party’s leadership said that the three MPs were warned in advance that they could not remain in their posts as parliamentary private secretaries if they voted against the bill. Nadia Whittome, Beth Winter and Olivia Blake defied the whip, which called on Labour MPs to abstain on the overseas operations bill. The legislation aims to introduce a presumption against prosecution for British soldiers serving abroad. The group of rebels led by former party leader Corbyn also included John McDonnell, Diane Abbott and Rebecca Long-Bailey. The proposed presumption against prosecution applies to offences such as war crimes and torture and critics say it breaches international humanitarian law, although the government says it is designed to end vexatious litigation against the armed forces. “I thought the bill was a matter of conscience,” Whittome told ITV’s Robert Peston But she added that it was “reasonable” for colleagues to decide to abstain and try to amend the legislation during the later stages of its passage through parliament. She said the bill was “anti-veteran, anti-human rights, and would effectively decriminalise torture – and that’s why I voted against it”. Earlier, Corbyn had said: “I have grave concerns that, as it stands, the overseas operation bill the House of Commons is discussing today defies and undermines international law.” The move against the three MPs is an indication of the firm discipline Keir Starmer intends to exert over his party — and underlines the continued tensions between leftwingers and the new leadership. Party sources indicated they were not unhappy that Corbyn had broke with his successor Starmer over the bill, arguing that it created a dividing line between the past and present leaders. During the debate on the bill, the defence secretary, Ben Wallace, angrily accused Labour of having taken Britain into “illegal wars” when the party was last in power in a heated Commons exchange during the second reading debate. A clearly irate Wallace intervened as John Healey, the shadow defence secretary, was arguing that the bill risked breaching the Geneva conventions that outlaw torture and war crimes because it proposes a presumption against prosecution after five years for British soldiers serving overseas. “Much of the mess we are having to come and clean up today is because of your illegal wars, your events in the past,” Wallace said, accusing Healey of making “wild allegations” about the intentions of the bill. A surprised Healey said: “That is not worthy of the office of the secretary of state for defence. We are dealing with matters of torture, war crimes, [Ministry of Defence] negligence, compensation for injured troops and compensation for the families who have lost their loved ones overseas.” The last time a minister had suggested a war was illegal at the dispatch box was Nick Clegg describing the Iraq war in 2010, a statement that he was forced to clarify amid concern it could expose the government to legal action. The then deputy prime minister said that he was speaking in a personal capacity, while international lawyers warned a statement by a government minister in such a formal setting could weaken the UK’s position in the courts. Allies of Wallace said he had no intention of retracting or clarifying his remarks, which unlike Clegg’s were not linked to any specific conflict. Britain fought wars in Kosovo, Afghanistan and most controversially in Iraq when Labour was last in government, and was broadly involved in the so-called “war on terror” alongside the US. The bill passed at second reading by 332 to 77, with the Scottish National party and Liberal Democrats joining the 18 Labour rebels in voting against.