Amid the granite-grey cobbled streets of Old Aberdeen lies the mosque and Islamic centre which serves the city’s small Muslim population.
It is here, a short walk from the Renaissance architecture of the university’s King’s College, that Abdul Raqib Amin came to pray as a young man, surrounded by the peaceable adherents of his faith.
Amin, however, was to undergo a conversion to a more radical cause, one built not on peace and love, but on violence and jihad.
It was a conversion brought about not by the imam of his local mosque, but by slickly produced propaganda videos shared on social media.
Ultimately, it was a conversion which led to his death in a hail of bullets at the hands of an Iraqi army SWAT team.
A picture of Amin taken before his decision to join the group calling itself Islamic State (IS) shows him on a night out with friends. He is clean shaven, his hair cut short. He could be the member of a boyband.
Contrast that with a later image showing him in army fatigues, bearded and grinning as he stands behind an anti-aircraft gun – the man dubbed the “Jihadi Laddie” by the tabloids.
Amin was reportedly killed in a gun battle in 2014, although details remain sketchy.
At one point, individuals like him were the main concern of the police and security services: angry young men trained on the battlefields of Iraq and Syria and preparing to bring the fight to the streets of Britain.
While that risk has not gone away, Wednesday’s attack in Westminster – the deadliest since the 7/7 attacks nearly 12 years ago – was carried out by a 52-year-old father of three with no apparent links to international terrorism.
Khalid Masood, born Adrian Russell Elms in Kent, had a string of aliases almost as long as his criminal record.
There are those who believe his actions on Wednesday were simply the latest entry on that long and varied ledger, that they should be denied the wall-to-wall media coverage which provide a publicity boon for the evil masterminds of IS, whether they had a role to play or not.
While his motivations remain unknown, more details are emerging of Masood himself.
He is understood to have converted to Islam while in prison and appears to have enjoyed the comfort of a middle-class existence at points during his 52-year life.
If nothing else, his story underlines the size of the task faced by the security services, where a car can become a weapon and a man like Masood can become a lone wolf.
As Masood carried out his attack in the shadow of the Palace of Westminster, Scotland’s top police officers were gathered in a nondescript meeting room at a Stirling hotel.
Chief Constable Phil Gormley, flanked by senior colleagues, was appearing before the bi-monthly meeting of the Scottish Police Authority.
Amid the tiresome corporate waffle – the force’s £47m budget deficit was described as an “elephant” to be eaten away “a bite at a time” – news of the events in London began to break.
Deputy Chief Constable Johnny Gwynne, who began his police career with the Royal Ulster Constabulary (RUC) during The Troubles, was the first to leave.
Gwynne headed straight for Gartcosh, where the multi-agency “crime campus” sits alone in a North Lanarkshire field, irreconcilable with its surroundings as if dropped from the sky.
As designated “gold commander”, he was tasked with taking strategic oversight of Scotland’s response to the Westminster attack.
Even before the senior officer had arrived, however, a well-rehearsed plan had swung into operation, with armed response vehicles (ARVs) deployed to the Scottish Parliament and nearby Holyrood Palace.
With no intelligence suggesting an imminent threat to Scotland, the increased visibility of firearms officers was described as a “reassurance” measure.
That included an increase in the number of ARVs at various places across the country.
Police Scotland admitted last year that it had been forced to update its planning following a new wave of attacks across Europe, most notably the multi-site armed assault on Paris in November 2015 which claimed the lives of 130 people.
An additional 124 firearms officers were trained, increasing the overall number in the force by a third.
But while Authorised Firearms Officers (AFOs) carrying Heckler & Koch submachine guns can still be seen at Scotland’s airports, Police Scotland no longer trains its officers to that standard, preferring instead to rely on more mobile and highly trained ARV officers.
Following Wednesday’s attack, the force also reassessed security arrangements around a number of upcoming events, including Scotland’s match against Slovenia at Hampden and a series of parades scheduled to take place in Edinburgh.
“This was a terrible and tragic event which took place in London,” says Assistant Chief Constable Bernard Higgins. “But if it wasn’t clear at the time, it certainly is now – this was very well contained by the Metropolitan Police.”
A former Strathclyde Police officer, Higgins already had first-hand experience of losing a colleague even before Masood murdered PC Keith Palmer on Wednesday.
As a young officer, Higgins was on duty in 1994 when PC Lewis Fulton was stabbed to death by a schizophrenic in the Gorbals area of Glasgow.
Higgins didn’t believe in a fully armed force then, and he doesn’t now.
“I’ve been on record many, many times saying that one of the strengths of Police Scotland and British policing is the fact that we are an unarmed service and that we police by consent, going back to the Peelian principles of 1829,” he says.
“My view is that right now the public don’t want an armed service. What they want is a police service which has an armed capability to mitigate the highest level of threat.”
Nor does he believe that most police officers want to be armed.
“I never have a shortage of people volunteering to be a firearms officer, but I’m not overwhelmed by it either. I don’t have 17,000 people putting in applications to be a firearms officer.”
The senior officer’s view on armed policing is nevertheless a contentious one.
A police source, who asked not to be named, said that while not all officers were in favour of being armed, there is now a growing number in support.
“It’s not because I believe they’re going to be capable of preventing any attack in the future,” he says. “But every police officer should at least be capable of responding to try to mitigate the effects of one.
“Police have a baton which is useless and a spray which more often than not incapacitates the officer rather than the intended target.”
No-one ever hears about the successes. The successes aren’t news.
For every attack like the one in London on Wednesday, there are many more plots that are foiled by intelligence gathering and solid police work.
Until Khalid Masood smashed his hire car into a crowd on Westminster Bridge, there had been no mass casualties since the 7 July bombings of 2005, in which 52 people lost their lives.
That is not to say the spectre of terrorism has not been with us. The murder of Lee Rigby in 2013 and the killing of MP Jo Cox last year served to underline the threat posed by violent and unstable individuals twisted by ideology.
But despite the absence of attacks like those seen elsewhere in Europe, the number of plots disrupted in the past two years alone is in double figures.
The same absence of media attention is true also for those who have been turned away from violent radicalism.
For every Abdul Raqib Amin, there are many more who have benefited from either organised intervention or simply the concern of their family and wider community.
It is here the Police Scotland approach of building community relations and intelligence gathering is contrasted favourably with the UK government’s controversial Prevent strategy.
Human rights lawyer Aamer Anwar has seen at first hand the human cost involved when things do go wrong.
He represents the parents of Aqsa Mahmood, who despite enjoying the privilege of a private education and a childhood in Glasgow’s leafy south side, chose to marry an IS fighter in the currently besieged Syrian city of Raqqa.Since Mahmood’s dramatic rejection of her former life, she has rarely been out of the press, accused of everything from “recruiting” three London schoolgirls to glorifying the terrorist attack on British holidaymakers in Tunisia.
In 2014, when her story first came to light, Mahmood’s social media accounts helped chronicle her radicalisation and its alarming progression – she had gone from sharing the sorts of videos and memes beloved of teenage girls everywhere to the black propaganda of IS almost overnight.
“There doesn’t seem to be a clear plan on the part of the authorities of how to de-radicalise,” says Anwar.
“The UK government approach is piecemeal, while the Scottish Government doesn’t seem to have any real plan at all – it’s haphazard.
“The approach the police in Scotland have adopted is the one which achieves the most success. It’s about intelligence gathering and having contacts in all sections of the community so that if there is an issue, people will go straight to the police.”
Anwar says the much-maligned Prevent strategy has been a failure. He argues that those returning from foreign battlefields should be used to help stop young people turning to terror..
“If you’re radicalised, the last thing you’re going to do is go along to some training event conducted by the men in grey suits,” he says. “Just because a man with a beard tells you that Islam is a religion of peace, that’s not going to make you roll over and say ‘fine you’ve convinced me’.
“The people who have been radicalised and have returned to this country, those are exactly the sort of people we need to speak to young people about why it’s wrong and what the reality is.”
The importance of good community policing is a view shared by Professor Martin Innes, a terrorism expert based at Cardiff University.
“If you get community policing right, the public will become the eyes and ears for the police,” he says. “That’s really important and allows the police to focus their efforts.
“The UK policing model is founded on prevention. Investing in knowing where the risk and threats are, that’s where effective prevention lies and what robust community policing provides.”
For Professor Innes, effective community policing involves having a visible presence and building long-term relationships in the community.
That has been the modus operandi of Scottish policing long before the creation of Police Scotland in 2013.
However, there is now genuine concern that a recently launched 10-year vision for the force – designed to meet the twin challenges of shrinking budgets and emerging threats – could undermine that good work.
One police source believes the 2026 strategy will turn community policing “on its head”.
He says: “If we get to a situation where we are withdrawing police officers from communities and only delivering reassurance through visible patrols when something goes wrong… you make it more and more difficult for police to build confidence with communities.
“It also becomes more and more likely that instead of prevention, you’ll be dealing with tactical response to incidents. It’s better to invest in having people in communities to prevent these things in the first place.”
There may yet be lessons to be learned from the attack on Westminster. There may, however, be none.
If the actions of Khalid Masood turn out to be those of a violent and disaffected loner, then what can we realistically expect our police and security services to have done to prevent them?
The threat we face is complex and challenging – it requires more than a knee-jerk response.
Sadly, it appears to be a challenge we will all have to live with for many years to come.