When Alex Ippoliti and James Fredrick met two months ago, the men bonded over their shared affinity for cycling on gravel roads. There weren’t many in Alaska, where they lived, but they thought a weekend ride together might be fun.

They went out on Saturday morning at a military base in Anchorage, where civilians can explore miles of trails that snake through thousands of acres of woodlands.

“It did not go as planned,” Ippoliti told The Washington Post in a bit of an understatement.

It had been exactly one week since black bears in different parts of the state fatally mauled two people. Ippoliti wore bear bells on his bike and as he had done for six years, and carried a can of bear repellent spray. But the cyclists didn’t discuss it when they set out at about 8:30 a.m.

The new friends were just 30 minutes into their ride, near some railroad tracks and a lake, when the bushes just ahead of them on the trail began to shake. They slowed down and paused for a moment, but the rustling stopped, so they started again.

Ippoliti led by a few yards and had just safely passed the crackling bush when he heard a crash and shouts from his friend. He stopped, turned around and saw the bear.

It charged nearly 30 yards, knocking Fredrick from his bike and slashing his neck and torso. Fredrick, Ippoliti remembers, calmly called out for help.

“All the options ran through my head really quick,” Ippoliti said.

Could Fredrick get back on his bike? Should he flee to get help?

Instead, Ippoliti grabbed his bear spray and started yelling.

The distraction worked. Just 10 seconds after it first attacked, the bear abandoned Fredrick and turned its attention to Ippoliti.

He deployed the spray and immediately panicked, unsure if the mist would reach the massive creature. Sometimes the spray doesn’t work on bears, he knew. He worried the bear would charge him anyway.

“I’m going to die,” he said he thought.

But instead, the bear retreated back to the bushes from where she emerged and Ippoliti rushed to his bleeding friend.

Ippoliti, 34, an Air Force veteran and Air National Guardsman, said his military training may have prepared him for the high pressure situation unfolding around him. He told Fredrick, 33, community engagement director at the Anchorage Concert Association, to apply pressure to his wounds while he grabbed his phone and dialed 911.

Reception is often spotty deep in the woods, but he was able to maintain a connection and direct officials to their location. All the while, the bear stayed close, and the men eventually noticed she was guarding a cub in the tree above them.

At this point, Ippoliti recalled, Fredrick decided that hanging around there put them in too much danger and that they needed to leave.

Together, the men walked nearly a quarter of a mile. Fredrick, bleeding, grew exhausted and worried he would faint, so they would briefly pause as they walked. At one point, Ippoliti wrapped his long sleeve T-shirt around Fredrick’s neck wound.

About 10 minutes after the attack, park officials found the two and rushed Fredrick to the hospital, where he remains in stable condition. He suffered a major laceration to his neck and lost part of his bicep muscle, reported the Alaska Dispatch News. He got stitches on his nose and eyebrow.

“Alex straight up saved my life,” Fredrick told the newspaper. “I’d be dead right now without Alex.”

Ippoliti visited Fredrick in the hospital and has talked to him several times by phone. Their trip, he told The Post, was an unconventional way “to get to know somebody really quickly.”

“We saved each other’s lives,” he said. “It was really both of us working together that got us out of there.”

Alaska Department of Fish and Game spokesman Ken Marsh told the Dispatch News that biologists are investigating the incident, but don’t consider the attack predatory based on initial information.

“It sounds like the sow did what brown bears often do when they perceive a threat,” Marsh told the newspaper.

Later Saturday night, another brown bear attack was reported outside the town of Hope, according to authorities. A man was walking with his dog to retrieve firewood when they encountered the bear, reported the Dispatch News. When the bear charged, the man scurried up a tree, authorities said. The bear swatted him down and batted him around before fleeing into the woods with its cub.

The man sustained “minor injuries,” according to the newspaper.

Those attacks, Marsh told the Dispatch News, differ vastly from the ones reported last weekend, which were described as predatory. In those incidents in different parts of the state, black bears appear to have targeted and fatally mauled a teenage runner and a biologist.

Marsh called those attacks “extremely troubling and very, very rare,” reported the Dispatch News.

“There’s no denying we’ve had a high number of attacks in a very short span of time,” Marsh told the newspaper. “I’ve talked to a couple biologists about this and the answer is … nobody really knows why yet.”

The attacks, though, won’t keep Ippoliti out of the woods, he told The Post. Bears are as much a part of the Alaskan wilderness as trees.

Content from Allstate This content is paid for by an advertiser and published by WP BrandStudio. The Washington Post newsroom was not involved in the creation of this content. Learn more about WP BrandStudio.