An 8-year-old boy was bitten on the head Wednesday night by a mountain lion, Colorado wildlife officials said.

The boy was jumping on a trampoline with his brother around 7:30 p.m. when a friend called to him from a nearby house, Colorado Parks and Wildlife said in a release. When the boy ran to visit the friend, he was attacked by the mountain lion.

"The kid was running, and it probably triggered the lion's natural response to a prey animal running," Mark Lamb, wildlife manager, said in a release. "We all hope that the child will be alright, and you just hate to see this occur."

The boy’s brother ran inside and told their father something was wrong. The father came out, found the animal on top of his son and scared off the mountain lion.

"He did what a father would do, run out and protect his son knowing that he was in trouble," Jason Clay, parks spokesman, told KCNC. "The father saved his son's life."

The boy was taken to a hospital, where he was in serious but stable condition, KCNC reported.

Because the animal attacked a human, it must be euthanized, wildlife officials said. They set traps and used dogs to try and track the mountain lion.

On Thursday, a homeowner realized one of his goats was missing, saw two mountain lions and called wildlife officials.

Officers were already in the area, which was about a mile from where the boy was attacked. They captured and euthanized the animals, which were about 12 months old and 65 pounds. A necropsy will be conducted to determine if they are the same lions involved in the boy’s attack.

"That is how we would be able to confirm with absolute certainty that we got the mountain lion from the attack," wildlife officials said.

Because the mountain lions were feeding on livestock, they can be euthanized. If a mountain lion is captured alive in a trap, it will be kept alive until DNA samples are tested. If the results are negative, the lion will be relocated, officials said.

Officials are still monitoring mountain lion activity in the area but do not have plans to actively search for them.

Mountain lions have attacked humans 22 times since 1990, with three attacks coming this year, officials said. A trail runner was attacked Feb. 4 and there was another attack Aug. 10. The last year there had been a mountain lion attack was 2016. The last time there were three attacks in a year was 1998.

"We don't want people to panic, they are very aware of all the wildlife that lives around them, but the proper precautions need to be taken," Lamb said in a statement. "There are obligations that people must be committed to for living responsibly with wildlife."

Three more mountain lions were seen on the property where the goats went missing Friday, but no more goats have gone missing since.