A former prosecutor has admitted a story he told a film crew about advising a judge over Roman Polanski was a complete fabrication.
In a 2008 documentary, David Wells said the judge took his advice to give Polanski additional prison time.
The film-maker's lawyers later argued this was misconduct as part of a bid to dismiss the entire case against him.
The director is currently being held in Switzerland over charges of unlawful sex with a 13-year-old girl in 1977.
Wells said he exaggerated his actions in the documentary called Roman Polanski: Wanted and Desired when he found out it would only be shown in France and not the US.
"I made that up to make the stuff look better," he said.
Although Wells, now retired, did not handle Polanski's case, he did have frequent interactions with trial judge Laurence J Rittenband, who has since died.
Wells has admitted he "embellished" the story and said he is he sorry he did it.
"I'm a guy who cuts to the chase - I lied. It embarrasses the hell of me," he said.
"I cost the DA's [Deputy Attorney] office a lot of money and aggravation over this."
Polanski pleaded guilty to unlawful sex with an underage girl following a plea bargain in 1977. Further charges including rape and sodomy were dropped as part of a plea bargain.
He was initially sent to prison for 90 days, but ended up only serving 42.
The film-maker fled the country after the judge reportedly told lawyers he planned to add more prison time.
Polanski's attorneys later argued in a motion to dismiss the case that the communications between the judge and Wells were clear misconduct and violated Polanski's constitutional rights.
That motion was dismissed because Polanski was a fugitive at the time, though the judge acknowledged "substantial misconduct" in the original case.
The matter is now in the hands of an appeals court.
Wells said he would testify in court that he lied and has offered to give a sworn declaration to prosecutors about his actions.