MIAMI (CBSMiami) – Two former Miami police officers received long prison sentences Friday for protecting drug dealers who were actually FBI agents.

Kelvin Harris was sentenced to 27½ years and James Archibald received 120 months in federal court.

READ MORE: 'Hidden Worlds': An immersive voyage into deepest oceans & mesmerizing mangroves through state-of-the-art technology

The investigation started when Miami police received complaints that the officers were dirty.

The City of Miami Police Department launched its own probe and brought in the FBI. As part of the undercover operation, the officers believed they were being hired to help the “traffickers” move cocaine.

Schonton ‘Michelle’ Harris, James Archibald and Kelvin Harris (City of Miami Police)

Investigators identified the officers as Schonton Harris, Kelvin Harris and James Archibald.

Schonton Harris, who pleaded guilty with conspiring with other officers to possess cocaine, was sentenced back in April, to 15 ½ years in prison.

READ MORE: Haiti's contributions to South Florida in full display at Haitian Heritage Month Art Exhibition

Earlier this year, the US attorney said veteran officer Kelvin Harris and officer James Archibald were recruited by officer Schonton Harris. They reportedly took payments to protect individuals involved with money laundering and narcotics trafficking.

Schonton was paid $17,000, while Kelvin Harris earned $10,000 and Archibald made $6,500, Fajardo Orshan said.

The FBI said the people the officers thought were drug dealers were actually undercover agents.

Officials said the investigation lasted several months and it started with a single person coming forward to make a complaint.

In one case, the officers reportedly agreed to protect a shipment of two thousand opioid pills.

MORE NEWS: Gov. Ron DeSantis signs property insurance, condo safety reforms into law

Charges included conspiracy to possess cocaine with the intent to distribute.