"I made that up to make the stuff look better," Wells said.
He also said he overstated his actions after being told the film would air in France, not the United States. The film aired on HBO.
Wells' statement on the documentary later became part of the basis for a move by Polanski's attorneys to dismiss the case against the fugitive director, who was arrested in Switzerland on Saturday.
In France, several government officials who had initially rushed to Polanski's defense were being more cautious on Thursday, stressing that the renowned filmmaker is not above the law.
Wells, who retired more than two years ago, did not handle Polanski's case but was assigned to the courtroom where it was heard and had frequent interactions with the now-deceased trial judge Laurence J. Rittenband.
"They interviewed me in the Malibu courthouse when I was still a DA, and I embellished a story," Wells said about the film crew in an interview with The Associated Press Wednesday. "I'm a guy who cuts to the chase - I lied. It embarrasses the hell of me."
Wells said he was sorry about making the comments for the documentary.
"I cost the DA's office a lot of money and aggravation over this," Wells said.
Polanski was accused of plying a 13-year-old girl with champagne and part of a Quaalude during a modeling shoot in 1977 and raping her. He was initially indicted on six felony counts, including rape by use of drugs, child molesting and sodomy.
He pleaded guilty to the lesser charge of unlawful sexual intercourse; in exchange, the remaining charges were dropped, and the judge agreed to send Polanski to prison for a 90-day psychiatric evaluation.
But Polanski was released after 42 days and fled the country for France before sentencing 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.
One of Polanski's attorneys, Chad Hummel, declined to comment on Wells' comments. District Attorney's spokeswoman Sandi Gibbons said the office also had no comment.
Marina Zenovich, who directed the film, did not return a phone message seeking comment.
Wells' admission was first reported in a story by former O.J. Simpson prosecutor Marcia Clark on the Web site The Daily Beast.
Polanski's victim, Samantha Geimer, who long ago identified herself, has joined in Polanski's bid for dismissal. She testified at the time that Polanski forced himself on her - which he acknowledged in his guilty plea - but has said she forgives him and wants the ordeal to be over.
Wells said he would testify in court that he lied and has offered to give a sworn declaration to prosecutors about his actions, in case they need it. No one from the district attorney's office has contacted him since he made the offer several months ago, he said.
Wells said he showed Rittenband a copy of a newspaper that pictured Polanski with girls at an Oktoberfest event. Wells said he never talked about potential sentences and the judge would have seen the paper anyway.
Wells said he still believes Polanski should receive a much stiffer sentence.
Meanwhile, French government officials were softening their defense of Polanski.
Foreign Minister Bernard Kouchner initially called Polanski's arrest a "bit sinister," while Culture Minister Frederic Mitterrand said the filmmaker had been "thrown to the lions."
The reactions sparked a debate in France, and many complained that the government and cultural elites were unfairly rallying behind the director because of his fame and artistic talent.
On Thursday, Kouchner offered slightly more measured comments, saying "no one is above the law," according to an interview with Russia's Ekho Moskvy radio.
French government spokesman Luc Chatel was also quoted in French media saying Polanski must face justice like everyone else.