A former undercover police officer has confessed his lies in court more than 30 years ago may have sent 150 people wrongfully to prison.

Police said they had started a criminal investigation into the activities of Patrick O'Brien after he wrote to Chief Justice Dame Sian Elias and former Police Commissioner Howard Broad, saying he was racked with guilt after carrying a "dreadful secret" for more than 30 years.

Mr O'Brien, an undercover officer during drugs operations in the 1970s, was the star witness in court trials but he later confessed he lied on oath every time he testified, the New Zealand Herald reported today.

His confession was made in November 2007 and police hired Wellington lawyer Bruce Squire, QC, to investigate.

He interviewed Mr O'Brien in July 2009 and reviewed court files, and a copy of his completed inquiry was now with police.

Detective Inspector Bruce Scott, of Waitemata CIB, emailed Mr O'Brien last week asking if there was any other information he had which "may assist me in determining any criminal liability, or are there other persons that you consider need to be spoken to that could assist an inquiry relating to these matters"?

Mr O'Brien told the newspaper he would co-operate fully with the inquiry and plead guilty to any charges.

In his confession, he said he could not guess the number of people who were sent to prison because of his lies because he stopped counting arrests at 150, half-way through his three-year undercover stint.

He lied to the courts and juries to get convictions in every case, he said. As well, he was often high on drugs, including cannabis, cocaine, heroin and LSD - but never during trials.

Tampering with evidence was common and exhibits before the court were often not the drugs he had bought from the target.

However, the shame and stress of the work broke him and he resigned and fled New Zealand, "haunted, traumatised and scared".

His life had since been a tragic waste and he had never lost the demons that "rush around in my head."

Mr O'Brien was an undercover police officer from 1974 to 1977.