The G8 summit at Gleneagles in 2005 was deemed a top terror target but experts believed an attack on London was more likely, newly-released files show.
Officials’ chilling warning horrifically came true when Islamist extremists struck the capital instead of the remote Scottish town, killing 52 people.
Eight world leaders including Prime Minister Tony Blair, US President George Bush and Russian premier Vladimir Putin met at Gleneagles 15 years ago.
Issues including climate change and the plight of some African nations topped the agenda.
The high-profile, three-day event was marred by protests at nearby Auchterarder and in Edinburgh, which included violent clashes with police.
But on the second day of the conference, July 7, suicide bombers detonated devices on the London transport network, killing 52 and injuring more than 700 people in the deadliest terror attack on British soil since the Lockerbie plane disaster in 1988.
National Records of Scotland has released previously unseen documents detailing the planning of the summit, including a report from the Ministerial Group of Civil Contingencies.
Presented to the Scottish Cabinet in March 2005 by then Justice Minister Cathy Jamieson, it identified the summit as a terror target, but prophetically said the UK capital “is a more likely target than anywhere in Scotland”.
The report said: “There is real urgency about this.
“The threat from terrorism – in terms of conventional chemical, biological, radiological and nuclear (CBRN) attacks – remains at a historically high level.
“London is a more likely target than anywhere in Scotland, but the G8 summit will certainly bring Scotland into the middle of the frame temporarily and the east coast oil installations remain a constant concern.”
Despite the bombings in London, the summit itself appeared to run smoothly.
A post-conference report by Finance Minister Tom McCabe later that year said: “Given the amount of advance pessimism there was remarkably little disruption to the summit, while genuine protesters were able to make their points effectively.”
A total of 11,000 police officers were drafted in from across the UK, with an estimated 500 arrests.
The UK Government was pleased with the operation of the summit, according to the report, with Mr McCabe adding: “The public, private and voluntary sectors in Scotland worked enthusiastically, together and separately, to make the most of the summit.
“There was a real sense of teamwork.”