When the Gorbals hard man sat down in Barlinnie jail in 1976 and wrote the story of his life, he can little have imagined that it would become a bestseller, a film and, 40 years later, be reprinted as a classic of prison literature. Even less could he have dreamed that, by then, he would be a world-renowned sculptor living between Marrakech and the French Riviera with his actor wife, having moved from his home in Edinburgh 15 years earlier, not least to avoid being forever known as “Scotland’s most violent criminal” and to escape an unforgiving Scottish tabloid press that seemed to resent his success.

Yet that is what happened to Jimmy Boyle. When it was first published, A Sense of Freedom cost 80p and its cover promised “the most controversial social document since Cathy Come Home”. While the latter was Ken Loach’s indictment of homelessness in Britain in the 1960s, Boyle’s book, knocked out on an old Olivetti in six weeks, threw open the barred doors of the nation’s prisons in all their baleful brutality. Now Ebury Press has republished it with a foreword by another rebellious Scot, Irvine Welsh, and a rueful afterword by Boyle himself.

It is hard to overestimate the impact that his book had when it was first published. At the time, Boyle was serving a life sentence for the murder of a fellow Scottish gangster, Babs Rooney, a crime he always denied. What he did not deny was that he had been a violent and sometimes ruthless moneylender from the roughest of backgrounds in Glasgow. It was Boyle’s refusal to conform in prison that stood at the hard centre of the book. He covered himself in excrement to avoid being beaten up by prison guards, and fought what seemed like an unending battle with authority.

Redemption came in the shape of the special unit in Barlinnie, where some of Scotland’s most recalcitrant prisoners were given a measure of autonomy and, crucially as far as Boyle was concerned, presented with a chance to learn about art. He was released in 1980, married Sarah Trevelyan, a psychiatrist who had visited him in prison by way of a mutual friend – not as Boyle’s psychiatrist, as it is often wrongly suggested – and with whom he has two children, Suzi and Kydd. They settled in Edinburgh where he and Sarah set up the Gateway Exchange, a project aimed at helping to keep vulnerable young people off drugs. They parted company in 2000 having drifted apart. In the afterword to the new edition he writes of the “utter despair” he felt at the ending of their relationship: “No one was to blame. We just took two different paths without realising it, until it hit us.”

In the original version of the book, published jointly by Canongate and Pan, Boyle writes of having an argument with Rooney and of slashing him in the chest. There is an enigmatic footnote: “I haven’t been as forthcoming with the circumstances of Babs Rooney’s death as I have been on earlier incidents in the book. The reason for this is that, although I maintain I never killed him, I did slash him, therefore by law I am technically guilty of his murder … I am now familiar with all the facts leading to his death and what happened but I don’t feel they have anything to do with this story. So rather than create problems for someone else I have just given the details as I knew them then and my own part in it.” The afterword of the new edition clarifies matters: “The truth is Babs Rooney … was killed by my co-accused William Wilson. The whole dynamics of this sum up the world where I once lived. I kept strictly to the ‘no grassing’ rule. I put myself away for 15 years for the gangster badge of honour that I wasn’t a grass.” Wilson’s advocate, the late Nicholas Fairbairn QC, even told Wilson during the trial that he should count himself lucky that he was in the dock alongside the notorious Boyle.

Facebook Twitter Pinterest Jimmy Boyle with former wife Sarah Trevelyan. Photograph: Jeff Morris/ANL/Rex/Shutterstock

“The deal was that whichever of us got off would say ‘It was me that did it’ – in those days, thanks to double jeopardy you could not be tried twice for the same crime – but no one listened to him,” says Boyle, back at his home in Antibes. “It was the name of the game and we didn’t fall out over it at all. I never even thought about it.” Wilson is dead now, no longer at risk of any earthly judgment.

But given his desire to escape his past, why has Boyle decided to republish the book? “I’ve been the invisible man, but the publishers, Ebury Press, contacted my daughter, Suzi, and got in touch that way. It was quite a painful experience to go through the book again. To be honest, I still don’t know if it was the right decision, but it came at the time that they were stopping books from going into prison [the controversial decision by the former justice secretary, Chris Grayling, to restrict prisoners’ access to books, which caused national outrage and was eventually overturned in court]. It really angered me – I would be dead now without books. It struck me as something worse than the old Soviet Union would have done, and that tipped me over the edge.”

They’ve totally given up on prisons. I hope the book might be part of a debate about what has gone wrong

Other people’s books featured heavily in his life inside. There was, perhaps inevitably, Dostoevsky’s Crime and Punishment and some Dickens and Victor Hugo. Then, as his fascination with art began, he turned to Giacometti. He is dismayed by what has happened to the penal systems on both sides of the border. “They’ve totally given up on prisons. There are drugs everywhere. They’re spending a fortune and achieving nothing. I suppose I would hope that the book might just be part of a debate about all the things that have gone wrong.”

In many ways, A Sense of Freedom became a template for prison writing in Britain. There have been many such memoirs since. Some, such as those of the train robber Bruce Reynolds, (Autobiography of a Thief), Noel “Razor” Smith (A Few Kind Words and a Loaded Gun) and John Barker (Bending the Bars), have been self-reflective and well written, but too many have slipped into vainglorious cliche. As it happens, republication of A Sense of Freedom coincides with the arrival of Erwin James’s also very powerful book Redeemable, about what life and prison taught him. Both books should be on the bedside tables of Michael Gove and the Michael Matheson, Scottish justice secretary.

Boyle wrote a subsequent memoir, The Pain of Confinement, and a novel, Hero of the Underworld, which is now being republished in Germany. There was a story many years ago that Disney had bought A Stolen Smile, a novel he wrote about the Mona Lisa being stolen and hidden on a Scottish housing estate. “The Sunday Times had the story that I was being paid £2m by Disney for it and I told them it was absolute rubbish but it made no difference,” he says. “I was driving along one day with Kate [his wife, Kate Fenwick, the actor] and we had Riviera Radio on and it said that I had sold the rights for £2.1m. We stopped dead, we couldn’t believe it. But no, it was never sold and it’s sitting in a drawer somewhere.”

His writing has, however, now become part of his art in that he is binding in leather everything he has written. “I’ve still got bits of writing from when I was first in trouble in 1967, tiny bits on pieces of paper the size of a postage stamp. Everyone spills their guts these days in reality shows so I’m doing the reverse and tying mine all up,” he says with a laugh.

Many of the characters who play a part in the early edition of the book are dead now. Boyle attended the funeral in 2007 of Ken Murray, the visionary prison officer who played such a major role in the lives of both Boyle and the long-defunct special unit, and he remains in awe of his generosity and decency. He saw his boyhood pal, Padge Gallagher, with whom he would steal sweeties, just before he died of cancer. “He just said, ‘Is that you, Jimmy? I’m fucked’.”

Facebook Twitter Pinterest Jimmy Boyle on release from prison in 1982. Photograph: ANL/Rex/Shutterstock

He keeps in touch with Britain by reading the Guardian, the Times and the Evening Standard online and starting his day with Radio 4. He is dismayed by what is happening politically; he made donations to the Labour party in advance of the 1997 election but has since become disillusioned with them. “I thought they did some good things and then the Iraq war killed it for me. The great hope was that they would do things for all the deprived areas but the Gorbals is now worse than it ever was, drugs everywhere. They were very arrogant.” Not that he is a SNP supporter. “I was never a nationalist. There’s too much of that about.”

He rarely goes to the UK these days, now that his daughter is an interior designer in California and his son is working in the financial sector in Singapore. He is happiest in Marrakech where he spends most of his time and has his studio. His gang nowadays is a cosmopolitan bunch of artists rather than knife-wielding heavies. As for trying to be the invisible man, “Google has changed all that. There’s really no escape and you’ve got to live with it.”

In the original version of the book, there is a wonderful scene set in a pub called the British Lion on Hackney Road in east London. Boyle is on the run, under the protection of the Krays and having a pint when he notices a lorry drawing up outside and the presence of a suspiciously large number of men in overalls. They turn out to be plainclothes policemen and Boyle is overpowered and taken back to Scotland for trial and punishment. Now the pub has become an elegant wine bar called Sager and Wilde. Where once there was a “No Travellers” sign in the window, now there is a notice announcing: “Tonight we are showcasing New World Chardonnay and Pinot Noir.”

New world, indeed. In the new A Sense of Freedom edition, Welsh – another working-class Scot whose writing transformed his own life – notes in his foreword that the great pleasure of going to the Cannes film festival these days is that he gets to hang out with “this cultured, bookish man” who lives nearby and whose life is now “far removed not just from the impoverished circumstances which he grew up in, but also, ironically, from the grubby bedsit jakeyism of many of the redundant tabloid sleazebags who once hounded him”. Now, far, far from Barlinnie, the former hard man of the Gorbals is reflective, his thoughts those of a 72-year-old who has seen life at its most savage and its most compassionate. “I ask myself what was that all about? All that violence, theft, anger and hatred for territorial gain when in fact none of us own anything.”

• A Sense of Freedom by Jimmy Boyle is published by Ebury.