Many prisoners have discovered that yoga and meditation can help overcome the stress and strain of life behind bars. Prison authorities too are waking up to the possible benefits, providing classes in the hope of fostering a calm and positive atmosphere.

The precision of the poses is remarkable - and for Nick, a man in his early 40s, apparently effortless.

We're in a small yoga studio above a pub in west London, daylight filtering in through slatted blinds. Nick holds Warrior 2 - arms stretched horizontally, one knee bent, one straight behind him. Then he offers to demonstrate a handstand, and lifts himself on the palms of his hands, knees and feet together.

He is a model of balance and control.

"That's six years in prison," he grins.

Prison was Villa Devoto, in Buenos Aires, Argentina.

"It was the worst place I had seen in my life," Nick says. "They don't have cells, they have open wings, where you can have anything from 100 to 400 people per wing. There were no beds so you'd literally be like sardines sleeping on the floor."

He demonstrates this, lying on his side on his yoga mat, his head propped on his hand.

Nick was no innocent. Together with a friend, he'd run a highly successful business smuggling cocaine supplied from Colombia to Europe. They were multi-millionaires.

"We basically built up an empire on drug money. Most of it was laundered in Argentina. We opened a night club, had restaurants, jewellery shops, cars, boats, houses, villas," he says.

This all came to a sudden end one night in 2004 as Nick was leaving his night club and walked into a police ambush. It turned out that he'd been under surveillance for two years. He was given a 10-year prison sentence.

"In the beginning it was quite hard," he says.

Image caption An uprising at Villa Devoto (1996)

"Every week someone was killed, so you saw a lot of mindless violence, beyond what I'd ever, ever experienced in England - people with machetes, guns, lances. You'd literally see people being mutilated and cut to pieces and stabbed to pieces.

"In the prisons all the gangs would stick together. As we were a quite well-known English firm in Argentina we had a lot of Colombian contacts, so we were taken into a Colombian gang."

There's a huge intake of painkillers here - the women just want anything to kill their anxiety Viktoria Rydholm, Prison governor, Sweden

Nick lived on the open wings for about a year, until he and his co-defendant were transferred, by order of a judge, to a cell on their own.

"That was a really hard test," he says. "Because we'd gone from a life of madness to one of complete isolation, where there was nothing. We were literally just in a room with two beds and a table.

"And that was then when I got into yoga."

Nick discovered yoga by chance, through a book his cellmate had bought as a present for his girlfriend. What Nick didn't know then was that yoga is slowly being recognised by prison authorities all over the world as an activity beneficial to individual inmates, and, by extension, to the institutions themselves.

In the UK a charity was founded in 1988 with the purpose of bringing yoga and the related discipline of meditation into prisons. It is called the Prison Phoenix Trust and today it operates in about 80 prisons, either running classes or sending inmates books and CDs.

"We're really responding to a need the prisoners are expressing for something to help them with the tremendous amount of mental strain and mental pressure that they're under," says Sam Settle, the charity's director.

Image caption And at a prison in Chengdu, China (2010)

Where the Prison Phoenix Trust operates independently, funded exclusively by donations, in Sweden yoga has become integral to the prison system. The Swedish prison service employs a national yoga co-ordinator, whose job, among other things, is to train prison guards as yoga teachers.

The prison in Ystad in southern Sweden occupies a group of low brick buildings surrounded by fences topped with razorwire, on the edge of a town that is unusually well-known for a place with fewer than 20,000 inhabitants - Ystad is where Henning Mankell set his series of novels about the troubled detective Kurt Wallander.

This is a women's prison, one of five in Sweden, with 65 inmates serving anything between a month or two and life.

Some of them were murderers... and they tried constantly to interrupt me while I was meditating Htein Lin, Burmese artist

The women occupy single cells, furnished with a bed, desk and chair. Each has a toilet en suite. One inmate from Costa Rica says she burst into tears on arrival, astonished at such luxury. Villa Devoto this is not.

A corridor leads from the main entrance through a series of locked doors past the kitchen to the workshop area where the women assemble plastic components for the plumbing trade.

Further on, in what used to be a greenhouse, a group of women lying on mats are being guided through a series of breathing exercises. The wooden floor has been specially installed. Soothing music plays softly.

Afterwards the women talk willingly about their experience of prison - Annika, for example, who's in her 40s and serving a sentence of 20 months.

"This is a hard life in here," she says.

"And 90% of the people who are in here have drug problems, so if they come in here and they cut their drugs the same day, then you can imagine how they feel. And they get sick because they don't get their pills and they get mad and they lose their temper, for nothing."

The governor, Viktoria Rydholm, paints a picture of women arriving in prison under enormous stress. Many have left children behind. A lot of them are addicts, facing the prospect of a spell without recourse to narcotics, so they seek solace in prescription drugs.

Find out more Listen to Isolation, broadcast on the BBC World Service this weekend, September 28 and 29 The Documentary: Isolation Family life transplanted to Antarctica

"There's a huge intake of painkillers here," she says. "And there's a lot of medication for the stomach, and for everything else. The women just want anything to kill their anxiety."

Yoga, she says, has made it easier for the prison staff to motivate the women to change the behaviour that has brought them to prison in the first place. In other group activities, she says, there is often trouble, quarrelling.

"But when they are together in yoga, it's never any problem. Not once during these years has there been a problem with that."

Has it had a calming effect on the prison as a whole?

"There are no statistics, but I think that's the case. I think we have a calmer environment within the prison, because people themselves are calmer."

Meditation, too, has been taking hold in prisons from as far afield as Alabama in the US, and Burma.

There the artist Htein Lin, arrested on political charges in the late 1990s, found himself sentenced to a seven-year prison term, most of which he spent on death row in Myaung Mya prison.

"It was very dark and gloomy, and because it was built a very long time ago the roof used to leak, so the floor was always wet - and we had to sleep on the floor," he says. "There was no toilet, and one water pot, outside the cell."

Like Nick Brewer, Htein Lin got hold of a book - though on meditation rather than yoga. He began to teach himself, despite the attempts of other prisoners to distract him.

At one point I actually became grateful for being in prison because of this change that was happening within me through yoga Nick Brewer

"They were very dangerous. Some of them were murderers. Some of them had raped children. The only thing they talked about was crime, and they tried constantly to interrupt me while I was meditating."

He says the guards also were suspicious, but very gradually things began to change. Htein Lin won the trust of one inmate by offering to teach him to read and write. Then others began to express interest in meditation.

Eventually he felt able to approach the prison authorities to ask if they might keep the cell doors open while they meditated. The governor agreed - an astonishing change of policy.

"Before the doors had to be kept closed because if they were opened the prisoners would literally have killed each other," says Htein Lin. "Now the cell doors were open all day. They were only locked at night."

The prisoners, he said, would come to his cell one by one and meditate with him on a blanket spread on the floor.

"Some of them meditated for half an hour, some for an hour. That way we all had a chance to meditate."

There has been relatively little research into the effects of yoga in prison, so much of what is reported is anecdotal only.

But two academics at Oxford University recently published the results of a study conducted among inmates in seven prisons in Britain, which they say does show that yoga and meditation in prison can have profound benefits.

Miguel Farias and Amy Bilderbeck constructed their study based both on a questionnaire and a computer task that tested responses to a simple instruction. The prisoners were divided into two groups - one attended a 10-week course in yoga and meditation, the other simply carried out an exercise routine.

While the questionnaire results pointed to the positive effects of yoga, it was the scores provided by the computer task, testing impulsivity and attention, that convinced the academics that they were really on to something.

Nick, who spent six years in Villa Devoto, has no scientific evidence to offer. But he's convinced that yoga saved his life.

"If it wasn't for prison I wouldn't have got involved in yoga, I wouldn't be the person that I am today. I would probably be dead," he says.

"At one point I actually became grateful for being in prison because I could feel this massive evolution, this change that was happening within me through yoga. So I almost became like a grateful convict, happy to be where I was, paying the time for my crime and rehabilitating myself."

The one-time millionaire drugs baron with Porsches and speedboats and a glitzy Buenos Aires night club today runs a modest first-floor yoga studio on a quiet West London street. He rides a small motor scooter, with a big smile.

You can hear more in Isolation, which is broadcast on the BBC World Service this weekend, September 28 and 29