David Cameron ruled out UK involvement in military action against Syria after his authority and international standing were dealt a severe blow by defeat on the issue in the Commons.

In what is thought to be an unprecedented parliamentary reverse over British military action, Tory rebels joined with Labour to inflict a humiliating defeat on the prime minister.

A motion backing the use of force “if necessary” in response to last week’s deadly chemical weapons attack was rejected by 272 votes to 285, majority 13. Mr Cameron had already been forced to water down his stance — accepting Labour demands that direct British involvement would require a second vote following an investigation by United Nations weapons inspectors.

But the concession was not enough to win over enough coalition MPs, conscious that public opinion is heavily against any intervention and wary of the decade-long controversy over the Iraq war.

After the shock result and to shouts of “resign” from the Labour benches, Mr Cameron told MPs: “I strongly believe in the need for a tough response to the use of chemical weapons. But I also believe in respecting the will of this House of Commons.

“It is clear to me that the British Parliament, reflecting the views of the British people, does not want to see British military action. I get that and the Government will act accordingly.”

It was unclear how Mr Cameron’s failure to master domestic British politics could affect US and French plans for a swift cruise missile strike against Syria - whose government has denied using chemical weapons against its citizens - or what the impact would be on Mr Cameron’s standing in Washington.

A meeting of the UN Security Council’s permanent members this evening ended quickly with no sign of progress on an agreement over the Syria crisis. The meeting started breaking up after less than an hour, with the ambassadors of China, France, Britain, Russia and the United States steadily walking out. It was the second time in two days that the five Security Council powers had left a meeting on Syria with no progress.

Syrian president Bashar Assad has said his country “will defend itself against any aggression,” signalling defiance to mounting Western warnings of a possible punitive strike. UN chemical weapons inspectors toured stricken rebel-held areas near the Syrian capital of Damascus for a third day today.

Russia has made clear it opposes any military action in Syria and suggested the rebels may have launched last week’s attack that killed hundreds of people in suburbs east of Damascus.

British aides said Mr Cameron had not spoken to US president Barack Obama since suffering the parliamentary reversal, but that there had been regular contacts at other levels.

Dogging Mr Cameron’s steps is the memory of events a decade ago, when Britain helped the United States to invade Iraq after asserting - wrongly, as it later turned out - that former president Saddam Hussein possessed weapons of mass destruction. “I am deeply mindful of the lessons of previous conflicts, and in particular the deep concerns in the country caused by what went wrong with the Iraq conflict in 2003,” Mr Cameron told parliament today during a debate on Syria.

“One thing is indisputable: the well of public opinion was well and truly poisoned by the Iraq episode and we need to understand the public scepticism.”

Already embroiled in Afghanistan, Britain was then sucked into a second quagmire in Iraq, losing 179 soldiers in eight years of militant attacks and sectarian conflict following the 2003 US-British invasion that toppled Saddam Hussein. It was the defining moment of Tony Blair’s 1997-2007 premiership, provoking huge protests, divisions within his Labour Party and accusations that his government misled the public by manufacturing the case for war.

Mr Obama has set out the case for a limited military strike on Syria, but some US politicians say they have not been properly consulted.

British Conservative officials were furious at the delay, accusing Labour leader Ed Miliband of opportunism. “Ed Miliband is playing politics when he should be thinking about the national interest and global security,” a Conservative source said.

“He keeps changing his position, not out of principle but to achieve political advantage.” A senior Conservative source added: “A lot of the arguments over this could give succour to the (Syrian) regime”.

Mr Miliband replied: “We have got to learn the lessons of Iraq because people remember the mistakes that were made ... I am not willing to make those mistakes again.” He advised politicians not to rush to judgment “on a political timetable set elsewhere”.

After hours of negotiations between Mr Cameron’s political managers and the opposition, his office agreed that the UN Security Council should see findings from chemical weapons inspectors before it responded militarily and that parliament should hold two votes on military action.

That meant that parliament would vote later today on a government motion cautioning Syrian president Bashar al-Assad and authorising military action in principle only. It will need to vote again to authorise any direct military action. Labour said it would vote against the government today, while Syria wrote letters to British politicians urging them to avoid reckless action.