(CNN) -- A former Puerto Rico police officer was sentenced to 40 years in prison on Thursday for his role in providing security for drug deals in an FBI sting in which he received $2,000 per transaction, authorities said.
Javier A. Diaz Castro, 30, was convicted in December of two counts of conspiracy to possess with intent to distribute more than five kilograms of cocaine, two counts of attempting to possess with the intent to distribute more than five kilograms of cocaine, and two counts of possession of a firearm in furtherance of a drug transaction, a prosecutor said.
Diaz, along with 88 other law enforcement officers in Puerto Rico and 44 other people, were indicted in October 2010 as part of the FBI's Operation Guard Shack, which targeted public corruption and cocaine trafficking, federal authorities said.
As of Thursday, 128 of the defendants have pleaded guilty or have been convicted at trial, including Diaz, according to Assistant Attorney General Lanny A. Breuer and Special Agent in Charge Joseph S. Campbell of the FBI's San Juan Division.
Diaz provided security for what he thought were drug deals at least twice in 2010 -- but the transactions were part of the FBI sting, authorities said.
Diaz, a 10-year police veteran assigned to the frauds unit, carried his service weapon in the transactions, federal authorities said. Another Puerto Rico police officer allegedly brought Diaz into the criminal enterprise, authorities said.
U.S. District Judge Gustavo A. Gelpi for the District of Puerto Rico issued the prison sentence, authorities said.
CNN's Michael Martinez contributed to this report.