Updated

A bear charged and injured a 10-year-old boy in Yellowstone National Park on Thursday, before his parents were able to get a hold of their bear spray, park officials said.

The unidentified boy was transferred to a Montana hospital after suffering puncture wounds to his back, wounds around his buttocks and an injured wrist, the National Park Service said in a statement.

The Washington state family was hiking up the Divide Trail, southeast of Old Faithful, when a bear appeared from the brush and charged the family, park officials said. The bear chased the boy, who had run from the approaching animal, and knocked him to the ground.

The boy’s parents used bear spray about five feet from the animal’s face, driving it off. The family walked back to the trailhead and drove to the Old Faithful Ranger Station. Rangers sent them to a nearby clinic before the boy was transferred to Big Sky Medical Center.

It wasn’t immediately clear what caused the bear to charge or what species it was. Both grizzly and black bears call Yellowstone home.

Park officials said that visitors should not run if they encounter a bear and should stand their ground if the animal charges.

The last reported bear attack in Yellowstone was in 2015, according to the National Park Service. The park averages one bear attack per year.

Several park visitors had been injured in animal encounters earlier this year.

A bison gored a woman in June following two separate elk attacks that injured two women. In May, another woman was rammed and injured by a bison.

The Associated Press contributed to this report.