A mountain lion in California was tracked down Monday and euthanized after it attacked a 3-year-old boy, fire officials said.

The unidentified boy was attacked by the cougar at Whiting Ranch Wilderness Park in Trabuco Canyon. All six members of his family were hiking in the park when the mountain lion attacked and tried to grab the child by the neck.

“The mountain lion came out of somewhere, attacked the 3-year-old, grabbed him by the neck and started dragging him,” Captain Tony Bommarito at Orange County Fire Department, told ABC 7.

The father of the child hurled a backpack at the animal which made it loosen its grip on the boy. The lion then picked the backpack and climbed atop a tree.

“The father was carrying a backpack, he threw the backpack at the mountain lion, the mountain lion dropped the 3-year-old, grabbed the backpack, and went up in the tree,” Bommarito added.

Police were alerted about the attack. Law enforcement officials responded to the scene and found the animal on the tree. “The adult female mountain lion” was euthanized as it was a potential threat to public safety.

The child was rushed to a local hospital where he was recovering from his injuries. Authorities evacuated the park with the help of a helicopter during the hunt for the cougar.

Fellow hikers were shocked to see the mountain lion on the tree. “It was little unnerving but it had a backpack in its mouth and so it kind of caught us off guard and we didn’t know why it had a backpack,” Ryan Lynch, a witness, said.

Mountain lions are commonly sighted in the area and images of them loitering around were often captured in the surveillance cameras in the neighborhood.

mountain lion
A mountain lion makes its way through fresh snow in the foothills outside of Golden, Colorado April 3, 2014. Reuters/Rick Wilking