More than 5,000 armed soldiers could be deployed onto UK streets in the wake of any major terrorist attack, it has been revealed.
The plan would see an unprecedented military response to terrorism if Islamic State or other fanatics struck in Britain.
Details of the plan emerged after a secret document was mistakenly uploaded to a police chiefs' website.
It came as David Cameron set off on a four-day trade tour of Malaysia and Indonesia, where terrorism is likely to be at the top of the agenda.
The military contingency plan - in minutes from a closed session of the National Police Chiefs Council (NPCC) - has now been taken down.
But details of Operation Temperer reveal how up to 5,100 troops could be deployed to support armed police in an emergency.
The operation would see troops guarding key targets alongside police while intelligence officers hunted those behind the attack.
"Discussions were ongoing with the Government," the minutes added.
An NPCC spokesperson said: "The minutes of the meeting were uploaded last Thursday afternoon and removed and revised early Friday morning when it was identified that details from the closed session had been included."
During his Asian tour, the PM will push for closer cooperation in counter-terrorism between the UK and South East Asian states.
Around 500 people from Indonesia, and 200 from Malaysia, are thought to have headed to Iraq or Syria to join the militants.
Mr Cameron is planning to meet with Indonesian president Joko Widodo in Jakarta and Malaysian prime minister Najib Razak.
Speaking before his departure, he called on all countries to unite in the fight against IS .
He said: "We will only defeat these brutal terrorists if we take action at home, overseas and online and if we unite with countries around the world, unite against this common enemy.
"Last Monday, I set out what more we need to do at home to tackle this extremist ideology and build a stronger, more cohesive society.
"This week, I'll be talking to leaders in South East Asia about what they're doing to keep their country safe from these Islamist extremists.
"All of us face a threat from foreign fighters and from increasing radicalisation within our countries and it's right that we look at what help we can provide to one another.
"I think Britain can offer expertise on practical counter-terrorism work - dealing with the threat from foreign fighters and investigating potential terrorist plots.
"And I think Britain can learn from Indonesia and Malaysia on the work they have done to tackle the extremist ideology and to build tolerant and resilient societies."
Military activity amid the threat of terrorism has proven controversial in the past.
For example, there was criticism of tanks at Heathrow in 2003, following warnings of a plot to shoot down a passenger jet.
Meanwhile, surface-to-air missiles on rooftops and in parks for the 2012 London Olympics caused outcry among some residents in the capital.