An L.A. County sheriff's detective says under oath that he read Miranda rights to an auto-theft suspect after his arrest. Footage from a reality TV program shows otherwise.

The reality TV show "Bait Car" is supposed to catch car thieves in the act.

Undercover cops park a rigged car on the side of the road, conspicuously leaving the keys inside, while a television crew waits nearby for an unsuspecting passerby to take the bait and steal the car.

But in one recent sting filmed in cooperation with the Los Angeles County Sheriff's Department, the lead detective on the case ended up getting busted instead.

Footage shot for the TruTV program showed 28-year-old Keenan Alex come across a parked, shiny red Cadillac Escalade with the keys in the ignition and the engine running. After he gets inside and drives off, deputies pull him over and cuff him. In court, Det. Anthony Shapiro said under oath that he read Alex each of his Miranda rights from a card in his notebook before the suspect made incriminating statements, a transcript shows.

But unedited video for the program shows the detective never read the suspect his constitutional rights, including the right to remain silent and have an attorney present during questioning.

"You watch TV. You know your rights and all that?" Shapiro asked instead, according to the video reviewed by The Times.

After Shapiro's conduct was discovered, prosecutors dropped the case against Alex and sheriff's investigators launched a criminal perjury investigation of the detective, citing the conflict between his testimony and the video.

Combining law enforcement and reality TV has a long and sometimes controversial history, dating back to the long-running show "Cops." While such programs often record the questionable behavior of suspects, the "Bait Car" case shows the unblinking eye of the camera can also catch potential police wrongdoing.

After reviewing the tape of Alex's arrest, Deputy Dist. Atty. Christopher Frisco told a judge in February that Shapiro's contradiction "poses a very severe problem," according to court documents. Explaining why the D.A.'s office agreed to dismiss the case, Frisco said the footage showed that Shapiro had violated Alex's Miranda rights, which prevented the prosecution from using the defendant's incriminating statements. Frisco said prosecutors needed the statements to counter defense arguments that Alex's mental illness played a role in the decision to take the vehicle.

"I believe the statement would be crucial to putting on the case to win a conviction," Frisco told the judge, according to a court transcript.

Alex, whose criminal history includes brandishing a firearm and drug possession, admitted during a probation violation hearing for another case that he took the car. A judge allowed him to remain free as long as he continued taking his psychiatric medication and sought mental health treatment, records show.

Shapiro did not return messages for comment. His captain said the detective could not discuss the matter because it was the subject of an ongoing investigation. Sheriff's spokesman Steve Whitmore said Shapiro has been relieved of duty with pay.

Court documents show Shapiro was almost fired in 2008 over allegations that he received stolen property from a known felon. Internal sheriff's criminal investigators served Shapiro with a search warrant on his home and seized alloy car rims, a bicycle, a Honda generator and a Gibson electric guitar, court records show.

Shapiro denied the items were stolen, saying several came from his brother. Prosecutors declined to file charges, finding insufficient evidence the items were stolen. But after a separate investigation, the Sheriff's Department, which requires a lower standard of proof to impose discipline, moved to fire Shapiro.

The detective appealed the decision, arguing there was no proof the items were stolen, court records show. The department agreed to classify the allegations as "unfounded," while he agreed to a five-day suspension for using law enforcement records to check the criminal histories of two felons, including the man he was alleged to have received stolen property from and one of the detective's neighbors, according to court records.

The department's watchdog found serious flaws in the sheriff's internal investigation. Investigators, including a deputy who had previously worked in the same unit with Shapiro, inadvertently tipped off the detective before executing their search warrant and allowed him to be present for an interview with a key witness, according to a 2010 report by the Office of Independent Review. The report found that "investigative deficiencies hampered a potential criminal prosecution and forced the department to continue to employ a deputy it believed had committed serious crimes."