An eight-year-old boy was bitten on the head by a mountain lion outside his home in rural Colorado.

The attack – the third on a human by a big cat in the state this year – prompted authorities to euthanise two lions that were found roaming the area.

The boy had been playing on a trampoline with his brother at their home in the town of Bailey on Wednesday evening when a friend called out to him from a house next door.

When the boy ran to see his friend, the mountain lion pounced and bit him, according to Colorado Parks and Wildlife investigators.

The boy’s brother ran inside the home and told his father, who rushed outside and found the cat on top of his son. The mountain lion let go and took off running as the father approached.

“It’s quite heroic. He did everything that we would ask somebody to do,” Rebecca Ferrell, a spokeswoman for the wildlife agency, said about the boy’s father.

“He ran towards it. He was making himself large and loud. … His efforts almost certainly saved his son’s life.”

The boy, whose name has not been released, was taken to hospital in a serious but stable condition.

Colorado Parks and Wildlife tweeted on Thursday that a landowner within a mile of the site of the attack reported a goat was missing and two mountain lions were roaming the area.

Both lions were euthanised and will be sent to a lab in Wyoming for DNA testing.

Wildlife officials say they believe one of the big cats was involved in the attack because of proximity and because both matched the description given by the boy’s father.

Ms Ferrell said the children’s high-pitched voices probably sounded like prey to the mountain lion, and its instinct to attack could have been triggered when the boy started running to his neighbour’s house.

The encounter came after a mountain lion attacked a man scouting places to hunt elk in Big Horn Park, north-west of Denver, last week. He fought it off with a pocket knife and officials tracked it with hounds, killing it.

In February, a mountain lion attacked a runner on a trail in the mountains west of the city of Fort Collins. The runner used his foot to suffocate the young cat when it did not release its grip after the man hit it on the head with a rock and tried to stab it with twigs.

Ms Ferrell said mountain lions rarely attack people, but Colorado’s booming population is leading to an increase in encounters with dangerous animals.

There have been 22 mountain lion attacks on people in Colorado since 1990 and three deaths.