This shocking video shows a child being rescued by a cat when he was attacked by a dog.

Four-year-old Jeremy is filmed on CCTV playing innocently on his bicycle when a camera from another angle spots the dog heading towards him.

The dog - which belongs to a neighbour - looks under the car at the boy then wanders round, launching its attack in Southwest Bakersfield, California.

It grabs the boy's leg, pulling him to the ground, and shaking him vigorously before the cat leaps into action.

The cat, named Tara, jumps at the dog, startling it, his mother Erica Triantafilo, who was watering trees nearby, pulls him to safety.

The boy's father, Roger, posted the footage online. He said: "My cat defends my son during a vicious dog attack and runs the dog off before he can do additional damage. Thankfully, my son is fine!"

Jeremy had to have stitches following the attack, but otherwise he is doing well according to ABC23.

Jeremy said: "Tara is my hero."

Bakersfield police said the attacking dog, identified as an 8-month-old Labrador-Chow mix, had been surrendered by its owner's family after the Tuesday afternoon attack and was in quarantine and would ultimately be put down.

Police spokesman Sergeant Joseph Grubbs said the dog's owners, who live in the same neighbourhood as the boy, said the dog did not like children or bicycles.