In one dramatic five day period Barlinnie became the best known prison in the world - for all the wrong reasons.

Graphic scenes of roof top protest and terrified prison officers being held hostage were also shown across the world to a stunned audience.

On January 5, 1987 a group of violent inmates at Barlinnie had taken over.

It became the longest running siege in Scottish prison history and in turn would lead to major changes in the way our penal institutions were run.

The riot broke out in Barlinnie's 'B' Hall around 7:30pm following a number of seemingly unrelated incidents during the day, including an alleged assault on a prisoner by prison officers.

Around 41 were initially trapped by the rioters, but most of them eventually managed to escape. Five prison officers however had barricaded themselves in a cell on the third floor of the hall for their own protection. But the rioters had broken into the cell and captured them.

Though two prison officers were released unharmed the remaining three would be kept as hostages.

Later that day masked prisoners began appearing on the roof in balaclavas or hoods with eyeholes cut into them. They also used bedsheets as coats. to keep themselves warm in the bitter Glasgow winter cold.

Read more: The Barlinnie story: From beacon of reform to notorious superjail

By Monday night 24 prisoners had taken control of the top floor of B hall, which had enabled them to get on to the roof.

Over the next few days the rioters would roam across the rooftop tossing slates and concrete slabs on to the ground below. They shouted and screamed abuse at the prison officers, the watching media and governor Andrew Gallagher in particular.

One of the most dramatic moments, in the early days of the siege, came when one of the prisoner hostages was paraded on the roof with a knife to his throat as he screamed: "They are going to kill me."

Another enduring image from that time - also shown round the world - was of two rioters standing on chimney pots with their arms outstretched in a crucifix pose. 

On the the second day, the Scottish Prison Service named the three officers being held. David Flanagan, 28, Andrew Smith, 23, and John Kearney, 40.

The prisoners claimed brutality behind bars had sparked the riot, which was reflected in the three banners that were hanging from B hall. One read, in a reference to the governor, "Gallagher is brutality". A second read "to the death" and the third said "Sammy Ralston was tortured".

The Herald:

Ralston, nicknamed "The Bear" was serving six years on a robbery charge. The protesters claimed that he had been beaten by prison officers with sticks and gagged to muffle his screams.

At one point the wife of a protesting prisoner had turned up outside the prison walls complete with a baby in a pushchair. "You are only making it worse for yourself. Please come down. Ronnie, I love you," she shouted to her husband. "You are going to get hell. Think of the weans." Her husband shouted back from the roof: "Don't worry about me. I will be all right. Worry about the weans."

On day two cracks began to appear in the protest when eight of the 24 prisoners gave themselves up. On day three the 16 remaining inmates barricaded in B Hall agreed to release Andrew Smith in return for food. On the Thursday a second hostage, David Flanagan was handed back to the authorities. Several hours later the final hostage, John Kearney, was freed and four prisoners gave themselves up.

The remaining 12 surrendered shortly before 9.30am on Friday January 10, following a meetng with prison chaplain, Father John McGinley.

Read more: Glasgow's forgotten prisons and why Barlinnie was built

But there had been one final act of defiance.

Shortly after 9am, the last of the rioters went back on to the roof for the last time to sing "we shall overcome" before giving themselves up.

Newspapers were allowed into the hall to show the scenes of devastation including smashed cupboards, lockers tea urns and furniture and crockery destroyed. Despite the damage and the hostage taking, no one had died, however 34 prison offices had been injured during hand to hand fighting with prisoners in the early stages of the riot.

The end of Scotland's longest prison siege - 110 hours - also posed questions over why it had happened.

The mood in the prison had been ugly for months fuelled by news of disorder in other penal establishments. Rioting had already taken place at Saughton in Edinburgh and at Peterhead.

John Renton, then head of the Scottish Prison Officers Association, blamed overcrowding and 'undermanning' for the disturbances.

Later that year nine men stood trial at the High Court in Glasgow for their part in the riot and three - Allan McLeish, William Marshall and Hugh Twigg - were found guilty and sentenced to a total of 22 years.

Trouble at other Scottish prisons later that year increased the demand for change. One incident at Peterhead was only ended when an SAS unit stormed the building, ordered by Margaret Thatcher.

The time had come for a long, hard look at prisons in Scotland, Barlinnie in particular.

The various disturbances led to a more relaxed regime with prisoners eventually allowed their own cells, televisions, and access to telephones.

Even the notorious practice of slopping out, which caused much resentment, was eventually banned as was the opening of prisoner's mail.

The five day siege at Barlinnie was the single most dramatic incident in the jail's then 105 year history with various governors over the years thankfully there has been no repeat - so far...