A murder trial witness whose testimony helped send three innocent men to jail was an armed robber looking for police help with his parole, a jury has heard.
Ian Massey was visited in jail by the detective heading the inquiry into the 1988 murder of Lynette White in Cardiff, Swansea Crown Court heard.
Eight former police officers deny perverting the course of justice over the case against the men, known as the Cardiff Three, and the trial continues.
Mr Massey denies perjury.
Mr Massey also denies perverting the course of justice, as does former Det Insp Graham Mouncher.
The trial comes after an inquiry in to how five men were arrested over the killing of Ms White.
She was stabbed more than 50 times in flat in Butetown, where she worked as a prostitute, on Valentine's Day, 1988.
The five went on trial in 1990 for the murder of Miss White and became known as the Cardiff Five.
Three of the men, Tony Paris, Stephen Miller and Yusef Abdullahi, were convicted and jailed for life, becoming known as the Cardiff Three.
But they were released in 1992 when the Court of Appeal quashed their convictions.
The prosecution in the perjury trial claims Mr Massey wanted to win support from South Wales Police at a parole hearing that could result in an earlier release date from the 14-year jail term he was serving.
Nick Dean QC, prosecuting, said when Mr Massey had been asked at the 1990 murder trial if any offer of help had been made, he denied it.
Detective Inspector Graham Mouncher did the same, added Mr Dean.
Miss White was stabbed to death in a flat in James Street, Cardiff, in the early hours of 14 February, 1988.
In 2003 advances in DNA led police to Jeffrey Gafoor, who admitted murder and has already given evidence at the crown court trial, saying he acted alone.
Mr Dean said Mr Massey had been held in Cardiff prison, where he began supplying information to Greater Manchester Police in the hope that they would support his appeal against the length of his sentence.
But the help was not forthcoming and he lost the appeal.
Mr Massey then began telling South Wales Police that he had become friendly with some of the men awaiting trial for the Lynette White murder, the jury heard.
By August 1989, Mr Massey had been transferred to Long Lartin jail where he was visited by Mr Mouncher.
Afterwards, Mr Mouncher wrote to a senior officer saying that Mr Massey was due before a parole board in August 1991, and that the board would take into account any representations made by the police.
In September 1989, Mr Massey made a statement in which he said Mr Paris had confessed to murdering Miss White.
Mr Dean quoted to the trial what Mr Massey had said about Mr Paris: "He said he had been involved in the murder but it had not all been down to him."
Mr Massey also alleged that John Actie, one of the Cardiff Five cleared in 1990, had threatened to murder Mr Abdullahi by giving him a drugs overdose unless he agreed to plead guilty and to say the others had not been there, the trial heard.
Mr Paris has already told the court he had been entirely innocent of the killing and had never made the confession described by Mr Massey.
The trial continues.