The Harris County Sheriff's Office confirmed for the first time Thursday that a deputy shot in the leg during an undercover drug deal that went wildly bad was hit by a Houston police officer who mistook him for a criminal.

The shooting was part of a daytime fiasco that played out Nov. 21 in northwest Harris County when a civilian informant posing as a marijuana trafficker and driving a tractor-trailer rig, was killed by a cartel-connected attack squad.

Federal authorities are reviewing the incident to figure out what went wrong and what can be done to avoid a similar scenario.

After the truck was run off the road, driver Lawrence Chapa was repeatedly shot. His body was yanked from the cab by the attackers, who then were swarmed by law officers.

Deputy not named

The deputy, who was wearing civilian clothes, apparently had shadowed the truck, which was to have delivered the drugs to a location staked out by other members of a Drug Enforcement Administration operation.

"Per our lead homicide investigator, our deputy was shot by an HPD officer attached to the federal task force," said Christina Garza, a spokeswoman for the Sheriff's Office. "The HPD officer mistook our undercover deputy for a suspect."

Garza declined to identify the deputy because he works undercover. Authorities have not said why veteran HPD officer G. Haselberger was unaware of the deputy's identity. Haselberger has been on the force since 1982.

"These type operations are often complex, extensive and risky," said Javier Peña, head of the DEA's Houston Division.

Internal affairs probe

"It is always unfortunate when one of our own is harmed," Peña said. "While we always try to avoid these types of situations from happening, when they do, we go back to the drawing board to see how we can prevent them from happening again."

Houston Police spokeswoman Jodi Silva said that as a matter of procedure, the shooting of the deputy is being checked out by internal affairs.

Five men, at least three of whom are Mexican nationals, are charged with capital murder in Chapa's death.