The former squaddie was trying to buy firearms
ANTI-terror chiefs feared an I.S. nut was about to launch a deadly rampage at the Edinburgh Tattoo.
Muslim convert Gavin Rae, 37, was clocked by cops as he mixed with thousands of tourists in the city centre.
Gavin Rae was caged
Intelligence revealed the former squaddie — also known as Yaqub Rae — had been trying to to buy a haul of firearms.
He was caught in a police sting four months later and jailed.
The Tattoo alert was part of the case against the extremist but has only now been made public.
A source revealed: “Rae was a genuine threat.
Sleazy Lanarkshire lifeguard caught trying to take pictures of naked woman in changing rooms
GERS QC BUST
Footie lawyer who defended Rangers' EBT scheme goes bankrupt over HMRC debt days before Ibrox tax case
HEART OF GOLD FIRM
Old Firm legends dust off football boots in honour of tragic Celtic fan Lennon Toland
Unsuspecting couples caught romping on CCTV in passage behind Sunderland nightclub become viral hit
HAVE YOU SEEN THIS MAN?
Cops release CCTV images after TODDLER was brutally assaulted on Edinburgh train
Top scam busters reveal how they catch benefit cheats from tip-offs to state-of-the-art surveillance
THE SHOW SO RAUNCHY IT SHUT CLUB DOWN
Seedy nightspot closed down after vid emerges of stripper smearing herself in chocolate and rubbing her privates in punter’s face
“Edinburgh was absolutely heaving because of the festival. A terror attack had the potential for devastating consequences.
“Rae went on Princes Street and mixed with crowds from the Tattoo. There was a genuine fear that he could be about to launch an attack.
“Officers were on high alert but thankfully he ended up wandering about then going back to where he was staying.”
Extremist Rae agreed to buy weapons from an undercover cop he met in Edinburgh in 2015.
The Muslim convert was mixing with tourists in the city centre
He was nicked paying for a gun, ammunition and silencer in a hotel in Crewe, Cheshire, and caged for 18 years at the Old Bailey last July.
He also said he was keen to buy shotguns and an Uzi sub-machine gun.
Jurors heard Rae, of Preston, Lancs, was turned back three times en route to join I.S. in Syria.
He said he wanted a stash of guns to get back his four kids who had been taken into care.
We pay for your stories and videos! Do you have a story or video for The Scottish Sun Online? Email us at email@example.com or call 0141 420 5266