A Miami-Dade County narcotics detective passed along sensitive police intelligence to a violent gang of marijuana smugglers, allowing them to avoid arrest and even to target their rivals, federal authorities said Thursday.

The detective, Roderick Silva, was arrested after a federal grand jury indicted him on charges that he worked for the lucrative grow-house operation.

Silva’s arrest was not a surprise — he had been on administrative duty since the summer of 2009, when the investigation began.

But allegations of the extent of his work for drug dealers turned into another embarrassing blow to the county’s largest police department.

In April, a Miami-Dade Police Department internal affairs lieutenant, Ralph Mata, was arrested by the feds, accused of acting as a henchman for cocaine smugglers in an unrelated case. He is awaiting trial in New Jersey.

Silva, 45, is charged with aiding a conspiracy to distribute marijuana and with extortion. He faces up to 30 years in prison if convicted on both counts.

The detective is the brother of one of the key members of the notorious Santiesteban family marijuana growing-and-smuggling operation.

The Santiestebans — headed by patriarch Gilberto Sr. and joined by sons Derrick, Gilberto Jr., Alexander and Darvis — were charged two years ago along with 13 others.

According to the federal indictment released Thursday, Silva tipped off the group about upcoming police raids, allowing them to dismantle and move their indoor hydroponic grow-house operations.

Silva — who is alleged to have been paid by the gang — also passed along the locations of rival marijuana grow houses, information the Santiestebans used to stage home-invasion robberies, the feds say.

He also gave the clan tips on how to avoid police, and even passed along misinformation to his fellow detectives about the Santiestebans’ large-scale operation.

“Mr. Silva’s criminal conduct not only undermined the trust of this community, but also undermined the trust of the officers who served by his side,” said South Florida U.S. Attorney Wifredo Ferrer.

The younger Gilberto made headlines in May when the Miami Herald published a photo of his extensive back tattoo dedicated to the case. The tattoo featured names of the lawyers, judge, detective and agents in the case.

The investigation is not over.

Miami-Dade homicide detectives are also trying to determine whether the unsolved April 2006 slaying of a teenager in West Kendall is linked to an alleged Santiesteban grow house in the area.

After going to visit a girlfriend near Southwest 172nd Terrace and 153rd Place, Angelo Lopera, 17, was attacked and shot multiple times.

Investigators believe Lopera might have been killed because he was mistakenly suspected of visiting the neighborhood to steal harvested marijuana plants from the Santiestebans’ house at 17231 SW 153rd Pl.