HELENA, Mont. (AP) — A bear attacked and injured a hiker in Yellowstone National Park Friday morning, marking the first incident of a bear injuring a person inside the park this year, officials said. A bear fatally attacked a man just outside the park in April.

The 39-year-old man injured Friday was hiking alone on a trail near Mammoth Hot Springs when he encountered what he believe to be two grizzly bears. One bear attacked and injured the hiker.

The man sustained significant injuries in his lower extremities but was able to hike out on his own. He was transported to Livingston Hospital by park ambulance, Yellowstone officials said in a statement.

The Beaver Ponds Trail, where the hiker was injured, was closed until further notice. Park officials reported that staff were searching the area to make sure no other hikers were still on the trail.

Park officials in their statement urged visitors to stay 100 yards (90 meters) away from bears at all times, carry bear spray, stay alert, make noise when encountering bears and hike in groups of three people or more.

The last bear-related injury in Yellowstone happened in June 2020, when a grizzly bear knocked a woman to the ground and scratched her thigh.

The man who died after being attacked just outside the park was a backcountry guide out fishing alone. He was attacked by a grizzly bear on April 15 and died two days later.