A former garda who perverted the course of justice on two occasions and admitted having cocaine for sale or supply has been remanded in custody for sentencing at a later date.

Stephen Cooper, 29, allowed a friend take the blame when gardaí found the drug LSD during a search at the Electric Picnic music festival.

Detective Garda Stephen Courage told the court that on 5 September 2009, Cooper and two friends, Niall Wolfe and Luke Barnett, were at the music festival in Stradbally, Co Laois.

Mr Wolfe was asked by Cooper to bring his wallet to him inside the festival grounds.

When gardaí stopped Mr Wolfe and searched him they found the wallet contained LSD.

Mr Wolfe phoned Cooper who became agitated and Mr Barnett, who knew Cooper was a recreational drug user, agreed to "take the rap" and said the drugs were his.

Mr Barnett was prosecuted for possession of a controlled drug.

He pleaded guilty at Portlaoise District Court and was ordered to pay €300 to the poor box.

Cooper with an address at The Green, Kingswood Heights, Tallaght pleaded guilty to perverting the course of justice between 5 September 2009 and 2 September 2010 by knowingly allowing Mr Barnett to be wrongfully prosecuted.

At Dublin Circuit Criminal Court, Judge Mary Ellen Ring remanded Cooper in custody and adjourned the matter until 2 April.

Cooper also pleaded guilty to perverting the course of justice between 19 August 2010 and 21 October 2011 when he attempted to get Stephanie Lynch to make a false statement implicating Wayne Finane in the theft of a car.

On 18 August 2010, Cooper was driving his own jeep when he saw Ms Lynch and Mr Finane driving in a second hand car they had just purchased for cash in the city centre.

Cooper was with his then girlfriend, another garda, and he told her he recognised the car as being stolen. He followed the car before stopping it and arrested the occupants.

The next day Cooper invited Ms Lynch into Sundrive Garda Station and put pressure on her to make a statement saying that Mr Finane had picked her up in the car and that she had no involvement in buying the car.

As a result of this incident, gardaí began to monitor Cooper's movements and the following January gardaí stopped him and found €700 worth of cocaine in his wallet during a search.

Cooper pleaded guilty to possession of cocaine for sale or supply at Ormond Quay on 31 January 2011.

He also pleaded guilty to deception of Axa Insurance on 12 November 2010 by making a false insurance claim.

Cooper made a false report to gardaí that the canopy of his jeep had been stolen when in had blown off the car while he was driving along the M50 motorway on 15 September 2010.

Cooper was also charged with stealing a bag of cannabis herb worth €560 from Sundrive Garda Station on 27 May 2010 but this count was withdrawn by the prosecution.

Isobel Kennedy SC, defending, said her client's offending behaviour stemmed from a long standing drug addiction problem.

She said he is now free of this addiction, is married and has set up his own gym equipment business.

She said he comes from a very respectable, hard working family and that his actions have had a devastating effect.

Ms Kennedy said that Cooper began using cocaine at the age of 15 and was using it heavily by the time he joined the force at the age of 24.

She said his drug use soon escalated out of control.

She said he attended a residential drugs treatment programme at the Rutland Centre while he was a garda but later relapsed.

Ms Kennedy said that a previous court judgment has noted that prison is more onerous on individuals who have previously being members of the police force.