WARNING: This video contains images some viewers may consider graphic.

A heroic cat saved its young owner from a dog attack by hurling itself in between the canine and the four-year-old boy in Bakersfield, Calif., Tuesday.

Surveillance cameras caught the entire incident, which lasted less than a minute, on tape. The boy's father uploaded the footage on YouTube, where the video has gathered nearly four million views as of late Wednesday night.

Four-year-old Jeremy can be seen riding his bicycle in a driveway, when a neighbour's dog sneaks up on him around the side of a white vehicle.

The dog, identified by local news station KERO as an eight-month-old Labrador and Chow mix, bites the boy on his left leg, pulling him from the bicycle onto the ground and dragging him for a short distance.

The family's cat, Tara, sprints into the frame and hurls itself at the dog, causing it to release its grip on the boy. The cat then chases it away.

The boy's mother, Erica Triantafilo, then runs to Jeremy and checks his wounds, his father, Roger Triantafilo, explains in the comments section of his YouTube video.

She leaves Jeremy and chases the dog to ensure it doesn't attack him again, he writes.

"She was bit by the dog as she tried to pin him in his yard," he says, adding the owners regained control of the pup.

Jeremy appears to have suffered bite wounds and required several stitches.

"Tara is my hero," he told KERO, which identified and spoke with the family.