The police investigator even plays himself in the film based on the Valley youths who burglarized stars' homes. Defense lawyers could impeach his testimony in the court case, which isn't over yet.

When filmmaker Sofia Coppola set out to tell the story of the "bling ring," she wanted the movie to have an authentic, docudrama sensibility.

So the daughter of Francis Ford Coppola reached out to the Los Angeles Police Department investigator who cracked the case of the starry-eyed youths from the San Fernando Valley. Four years ago, their lust for stardom and money led them to raid the homes of young Hollywood, making off with Paris Hilton's designer clothes and Lindsay Lohan's artwork.

Brett Goodkin, a veteran police officer, signed on as a technical advisor to Coppola's "The Bling Ring," even playing himself on-screen. In a recently filmed scene, he slapped handcuffs on Emma Watson, the actress playing one of the burglars Goodkin nabbed in real life.

Police officers have served as paid consultants on Hollywood projects since the dawn of the crime genre. But what makes Goodkin's actions highly unusual is that the case is still in court, where his financial interest in the film is certain to become an issue raised by the defense.

Goodkin never notified prosecutors of his work on the movie, though his testimony is likely to be central at the trial of three remaining defendants. Informed by The Times of Goodkin's role, a spokeswoman for the Los Angeles County district attorney's office expressed shock. "We did not know, and now that we do, we have to evaluate what impact this may have," she said.

Legal experts said Goodkin's consulting work could significantly complicate the prosecution's case.

"This looks very unsavory, and it could make a big difference in attacking the credibility of the investigator," said Thomas Mesereau, a criminal defense attorney who defended Michael Jackson at his 2005 child molestation trial.

"Clearly, it presents a conflict of interest if someone's investigation becomes oriented toward creating a story or entertainment," Mesereau said. "It's certainly going to taint the investigation's motives and make them look unprofessional."

Stanley Goldman, a professor at Loyola Law School, called Goodkin's involvement in Coppola's project "a great birthday present for the defense."

"It's got to give the prosecutors pause as to whether they want to just try to settle this case before it gets in front of a jury," Goldman said.

Goodkin also finds himself in the uncomfortable position of being on the film production's payroll along with a key member of the gang, Alexis Neiers, whom Coppola has also hired as a consultant.

In a police report, Goodkin described the group's actions this way: "While this activity started as a twisted adventure … fueled by celebrity worship, it quickly mushroomed into an organized criminal enterprise."

Indeed, the investigator always seemed to grasp what was so tantalizing about the case and frequently spoke to media outlets — including Dateline and Vanity Fair — about it.

But when first contacted by The Times about the film, Goodkin was initially hesitant to discuss his Hollywood ties. "I'm distancing myself from that thing. I don't want it to look untoward," he said.

He said that he informed LAPD supervisors of his work on the production in January. But an LAPD spokesman said Goodkin is now under investigation for failing to get proper approval for his work on the film.

Cmdr. Andrew Smith said he was unaware of any policy that prohibits LAPD officers from working on films while cases are ongoing.

"We would obviously be concerned if an officer did anything that compromised the integrity of the case," said Smith, a department spokesman. "If in the course of our investigation we find out this case was compromised, we'll certainly take any action on that."

Asked what kind of details he provided to Coppola, Goodkin said that they mostly discussed police procedures involving search warrants and helicopters and that he did not reveal much information about the case itself.

"All she wanted to know from me was very generic cop kind of stuff, ensuring that her end product was plausible," said Goodkin, who received $5,000 to $6,000 for his work.

Still, attorneys for at least one of the bling ring defendants expressed outrage at his role.

"For him to be paid to play himself in a film where he is a critical witness against my client is highly inappropriate, and I'll certainly make sure the jury knows about it," said Robert A. Schwartz, who represents defendant Courtney Leigh Ames.

Nicholas Prugo, 21, thought to be the ringleader, has already accepted a plea deal that will send him to state prison for two years. Rachel Lee, 21, the daughter of a North Korean immigrant who allegedly masterminded the crimes with Prugo, is serving a four-year prison sentence.

Neiers, 20, the subject of a 2010 E! reality show, "Pretty Wild," that followed her to Hollywood clubs and on modeling gigs, is now on probation after serving 30 days of a 180-day sentence.