The Special Criminal Court has sentenced criminal gang leader Brian Rattigan to 17 years in prison for dealing almost €1m worth of heroin from Portlaoise prison.

Rattigan, 32, from Cooley Road, Drimnagh in Dublin, was running a drugs supply network by mobile phone from his cell in the maximum security prison.

He is currently serving life in prison for murder.

Earlier today, the court was told that Rattigan was a changed man and that he is now reliable, conscientious and mannerly.

On 21 May 2008, gardaí found 5kg of heroin in a shed at the back of a house on Hughes Road South in Walkinstown, along with a weighing scales, €36,000 in cash and a mobile phone.

On the phone were messages relating to the division of the heroin from a phone Rattigan had in prison.

He was caught by surprise at 9.30pm the following day when detectives burst into his cell while he was lying on his bed with a phone in his hand.

He threw the phone out the door, but it was recovered along with notebooks, three SIM cards and another phone.

Rattigan had sent coded messages about the drugs to his associates, including "Parro", "Dicko", "Ganko" and "Lips".

Heroin was known as "the dark" and when it arrived at the house Rattigan texted "the dark is there".

"Can you give me half a box of the bad thing for 13" was a text Rattigan received from a customer prepared to pay €13,000 for 0.5kg of heroin.

Rattigan texted "Lips" to "drop E30 up to the Paret man" - the 30 referring to the €30,000 found by gardaí at the base of a bed in the house.

One of the last orders Rattigan texted to "Lips" was to "get rid of ur phones quick", but by then it was too late.

Drugs squad detective Brian Robertson told the court that the overall profit on the drug deal would have been €900,000, but that Rattigan would immediately have made €30,000.

However, Rattigan's defence counsel today told the court that the offence happened five years ago and that he had come to a growing realisation that he had to change his life.

He said Rattigan was moving away from his previous associates and was now involved in education programmes in prison, including addiction studies.

Rattigan also starred in two prison Christmas pantos - Cinderella and The Wizard of Oz - and his ten-year-old daughter is now the most important factor in his life, the court heard.

While Mr Justice Paul Butler said the court accepted the prison reports that Rattigan was determined to change his life, there was no solid evidence and no basis for suspending any part of the 17-year sentence.

The judge also praised the "very useful and very frightening" evidence on the social and economic effects of drugs on individuals, families and society at large.

He said the court was very grateful because it was the first time it had heard such evidence and would be very useful beyond this case.