IT was 30 years ago when a place known as The Hate Factory in the north-east of Scotland exploded into the global spotlight.

Peterhead prison officer, Jackie Stuart, was already 57 by the time he was taken hostage by desperate criminals at the jail.

Yet, although he was stabbed several times during his ordeal, which dragged on for five days, he continued in the profession.

Indeed, six weeks after it happened, he had returned to work. And even now, at 87, the father-of-six still acts as a guide for visitors – at Peterhead Prison Museum.

It has changed beyond all recognition from the grim citadel that formerly housed Scotland’s most notorious criminals, many of whom were incarcerated for life and therefore had little to lose.

But while there had been outbreaks of lawlessness at other Scottish prisons in the months leading up to the explosion of violence at Peterhead, nothing could prepare Mr Stuart and his colleagues for the scale of the riot which erupted on September 28 in D-wing.

He recalled: “A colleague had placed an inmate on a minor report in the morning, but in the evening, when they [the prisoners] were out for leisure, the inmate tried to stab the officer who was involved. I went to his aid, as anybody would have done, but after wrestling him to the floor, I noticed the whole hall had become involved in the incident and events just spiralled from there.

“But, because one of the group of inmates could best be described as erratic, there were times when I was unsure how events would unfold. My focus throughout it was to try to keep everybody calm and save inflaming the situation even more.”

The ringleaders in the riot included characters such as Sammy “The Bear” Ralston, Douglas Mathewson and Malcolm Leggat, who were regarded as being desperate men who had taken all the discipline the prison service could throw at them.

After seizing Mr Stuart, they moved to an area in the roof space of the prison and quickly created a variety of barricades and booby traps, while using such items as burning bedding to ensure nobody could get near them.

As news spread of the crisis, the BBC screened footage of Mr Stuart being hauled on to the rooftop, where a hooded prisoner swung a weapon – which turned out to be a chair leg – at his head.

Mr Stuart says the prisoners were unpredictable and he did not know what they were capable of.

He said: “They were going to set fire to me, I would have had to try something then – something physical. It was too high to jump.”

As September turned into October, the story had commanded the international spotlight and Prime Minister Margaret Thatcher decided the status quo could not be allowed to continue. At that point the prison authorities liaised with senior politicians, including Mrs Thatcher and Home Secretary, Douglas Hurd, and the SAS’s involvement was sought.

At the start of October, about 20 men from the SAS’s on-call anti-terrorism team were flown from RAF Lynham in a C-130 to Aberdeen, and driven under police escort to Peterhead Prison.

The SAS personnel were kitted out in body armour, fireproof coveralls and respirators. They were armed with wooden batons, but were also carrying 9mm Brownings [handguns] and kitted out with flash bangs and tear gas.

They wore training shoes as it was felt army boots would make too much noise.

The operation was planned to ensure the prisoners were dealt with in a matter of moments, and it worked.

Mr Stuart says the first he knew of it was when one of the inmates landed on top of him.

He said: “He must have got the gas and stun grenades first. I only saw one SAS man. I just said to him that I was the officer. I was in prison clothing and he accepted that, but he’d probably had pictures of me and the prisoners beforehand.”