Britain's political class has been woken from its summer reverie with a shudder as the Syrian crisis creates a defining moment that will shape perceptions of all the main political leaders.

Ed Miliband, who takes pride in the way he confronted Rupert Murdoch over phone hacking, identified an even larger target on Wednesday when he announced that Labour would vote to block an immediate military strike against the Assad regime. While that created a parliamentary headache for David Cameron, Labour aides acknowledged it also marked a direct challenge to Barack Obama's plan to launch the strikes before the weekend.

Downing Street is, naturally, deeply irritated with Labour and borrowed Margaret Thatcher's famous warning to George Bush Sr after the Iraqi invasion on Kuwait, when it accused Miliband of undergoing a "wobble". The Labour leader had appeared to indicate for 24 hours that he would support military action subject to proper legal clearance.

But No 10 was forced to defuse a growing parliamentary crisis by announcing on Wednesday night that Britain would only take part in a military strike after a second parliamentary vote.

The Downing Street move was being cast by the government as a sign of the prime minister's determination to act in a consensual way. This was disputed by Labour, which said that at 5.15pm, two hours before the publication of the motion, the prime minister was ruling out a second vote.

Relations have been tense between Cameron and Miliband over the past 48 hours for one reason: both leaders are haunted by the spectre of Iraq and want to escape its legacy. Cameron wants to show he is respecting the UN and abiding scrupulously by the law. But he also wants to ensure he is not paralysed into inactivity by the actions of Tony Blair 10 years ago. Cameron famously agonised before voting in favour of the Iraq war.

Miliband wants to show he is prepared to stand up to a US president, even a Democrat. He also wants to ensure that the UN route has been exhausted. "We have been here before in not giving the UN weapons inspectors enough time," one Labour source said after the publication of the Labour amendment, which would delay action until after the inspectors have reported.

Miliband raised the legacy of Iraq in his meeting with Cameron and Nick Clegg on Tuesday afternoon in No 10. One source said: "Ed said to the prime minister: 'You have to realise that after Iraq nobody trusts any of us. We therefore have to exhaust every avenue.' It is not easy for the prime minister."

But the meeting became a source of deep irritation in No 10. The UN was briefly touched upon when Clegg told the meeting there needed to be a "UN moment". There had been intense discussions in government over the nature of UN involvement. Cameron had favoured a "presidential statement" in which the chairman of the UN security council would express unease over the attacks. "That is what you do when you can't get a UN security council resolution," one source said.

Miliband then telephoned Cameron on two occasions on Tuesday night after their face-to-face meeting to demand a bigger role for the UN. One government source described a Labour briefing in which it was reported that Miliband had asked for a "UN moment" as "creative licence". The source said: "Ed Miliband did not ask questions about the UN. He only mentioned it after Nick Clegg's remarks."

The demand by Labour explained, in part, why the UK presented a draft resolution to the five permanent members of the UN security council in New York. But a UN process was underway anyway. Britain's national security adviser, Sir Kim Darroch, discussed the UN with his US counterpart, Susan Rice, after Cameron raised the matter with Obama in a telephone call on Tuesday night.

On Tory benches, there is criticism that Cameron delayed his return from holiday after Obama made clear early in the week that the US was keen to act quickly. One source said: "No 10 miscalculated. They thought they had Labour in the bag. They didn't. They thought this was like a few drone attacks. It is not. It is Iraq-minus."