Seventeen-month old Blue was on a walk with his elderly owner in Bradford when he sniffed out a bag of heart-shaped pills and started eating them.
The owner took the bag and Blue home, but the dog started foaming at the mouth and was rushed to Bradford's pet hospital.
Blue made a full recovery and the incident has been reported to police.
The pet hospital is run by the animal charity PDSA.
Head nurse Miriam Wilson said Blue was in a critical condition when he arrived at hospital.
She said: "He'd collapsed and the toxins were causing organ failure. Life-saving treatment was started straight away.
"He was put on an IV drip and received activated charcoal to absorb the toxins. Without the treatment, he would not have survived the night."
West Yorkshire Police collected the remaining pills and disposed of them.
A whippet received emergency medical treatment after eating a bag of ecstasy tablets.