The Madrid police uploaded the video to their Twitter feed with the caption: '"Heroic" performance of our #4pawedcompanion Poncho, who did not hesitate for a moment to "save the life" of the agent, practicing the #CPR in a masterful way.
"'The dog is the only being in the world that will love you more than he loves himself' - John Billings."
The clip has gone viral on Twitter, racking up nearly 1.7million views since being uploaded three days ago.
One commenter said: "That's so true. Noble selfless and always helping."
Another wrote: "What a smart dog! It is worth its weight in gold. Adorable and tender."