A deputy was treated at a hospital after apparently being exposed to fentanyl during a traffic stop in Rosemead Thursday night.

Deputies found a handgun, a large amount of cocaine, methamphetamine and blue pills that were possibly fentanyl in the car, according to sheriff’s Lt. Laura Avelar. They arrested two suspects on drug charges, she said.

It happened by Garvey and Denton avenues around 9 p.m. Two deputies pulled over a sedan for a traffic violation, she said.

During the investigation, Avelar said the driver was detained and the car was searched. While searching the car, a deputy started sweating and falling back, she said. Other deputies supported him, she added.

By then, there were other deputies at the scene.

The deputy was given Narcan, a prescription drug used to treat opioid-related health emergencies. He was taken to Los Angeles County USC Medical Center, where he was treated. He was released Friday morning, Avelar said.