A grizzly bear injured two hikers in Yellowstone National Park on Thursday morning.

A group of four was hiking along Cygnet Lakes Trail in Wyoming when they spotted a young grizzly bear. A sow grizzly, presumably its mother, was spotted nearby and charged them, the Associated Press reports.

Two hikers sprayed the bears with bear spray and left the area. The two remaining hikers suffered injuries – one was hospitalized for claw and bite wounds.  The other hiker was treated on scene for minor injuries, park spokesman Al Nash told Reuters.

"Here is a group of people who took our advice: They hiked in a group and carried bear spray," Nash said. "While it didn't eliminate a chance of a bear encounter, everybody walked away alive."

The incident was the first reported bear attack in the park this year. Park officials won't take action against the mother bear since she attacked in defense of her cub in a surprise encounter with humans, according to Yellowstone bear biologists.

Yellowstone National Park requires visitors to stay 100 yards away from black and grizzly bears – asking hikers to use binoculars, telescopes or telephoto lens to observe the wild animals.

With roughly 600 protected grizzly bears roaming the 2,221,766-acre land, hikers are asked to be in groups of three or more and make noise while on the trail and use bear spray as a last resort if a bear approaches, KPAX reports.

The incident on Thursday took place in a densely forested area. “That would certainly limit their visibility,” Nash said about the bears.

In 2011, a 57-year-old man was mauled to death by grizzly bear in Yellowstone while with his wife on a backcountry hike. Similar to the recent attack, Nash said the death was caused by a grizzly sow protecting her cubs.

“There are steps you can take to enhance your safety, but they’re not guarantees,” Nash said about Thursday’s attack. “They did what we advised, and while two of the four were injured, they were able to walk out to the trailhead.”