Neither realized they were exposed to a microscopic cloud of the deadly drug fentanyl.
The detective caught the brunt of it.
RELATED: 'AVOID IT' Doctors warn about Fentanyl's potentially fatal effect
Sgt. Ray Kelly is with the Alameda County Sheriff's Dept. and said, "(At) one point he went into respiratory distress and stopped breathing, his lips turned blue and his eyes rolled back in his head and he went unconscious."
Alameda County narcotics, patrol deputies, and even K-9 units carry a dose of Narcan - an antidote to an opioid overdose - on hand.
But it didn't work.
Then they administered a second dose, which worked.
SEE ALSO: Targeted Justice, group whose content was printed on Fentanyl-tainted flyers, denies involvement in deputy's injury
But then the sergeant got sick from cross contamination from the detective. He refused to take the last available dose, just in case someone else needed it.
Friday was a wakeup call for Alameda County Sheriff Greg Ahern.
"We have to acquire more of these devices and make them more readily available," Ahern said.
The epidemic is growing and not all agencies carry Narcan.
Investigators believe fentanyl and other drugs were being mixed in room 278.
And anyone could have been exposed.
Motel guests said, "That's scary!" Another said, "I'm scared to sleep in my room!"
The sheriff hopes to have a thousand doses of Narcan available for his department by the end of this year.
SEE ALSO: What is Fentanyl?