MIAMI (CBSMiami) – A Florida undercover detective cane under the gun in a sting operation gone wrong.

It happened Monday outside a mall in Hillsborough County.

READ MORE: Miami Beach’s Deauville Hotel, made famous by the Beatles, poised for a comeback

The undercover cop was attempting to buy a gun from two suspects outside the mall, but as the transaction was taking place inside the detective’s car, the suspects tried to rob him at gunpoint.

That’s when other undercover deputies intervened.

READ MORE: Property insurance changes aimed at stabilizing market

The suspects then took off, but not before opening fire.

No one was hurt.

MORE NEWS: Coral Gables resident says city's automatic license plate recognition cameras are a constitutional violation

Deputies were able to catch up with one of the suspects, a 19-year-old.