Just after 2:30 pm, the officers took a man into custody at the parking lot of Trader Joe's on Nees and Willow in Clovis.
The man, later identified as 56-year-old Patrick Martin, had several active warrants.
Police say the officers were searching his car when they found a white substance in a plastic container. They packaged the container in a paper bag and put it in the trunk of the patrol car.
On their way to the Clovis PD headquarters, however, the officers began to feel shortness of breath and their heart rate rose. They were immediately treated at the scene and were transported to the hospital.
A drug task force examined the white substance, which tested positive for meth and fentanyl.
It is unclear whether the fentanyl caused them to be hospitalized.
Martin is facing multiple warrants and drug charges and will be transported to Fresno County Jail.
The officers have since been released from the hospital and are expected to be okay.