Moninda Marube knows what to do when you encounter a black bear. Stand your ground.

But that’s not what he did.

“At that time, you cannot think standing your ground once they start running toward you,” he told the Lewiston-Auburn Sun Journal.

Marube was a third of the way through his 18-mile run near Maine’s Auburn Lake on Wednesday when two bears suddenly appeared.

When they spotted him, they stopped. And he stopped.

“I’ve been running this road for four years. I’ve never thought of meeting a bear here,” Marube said. “Unfortunately, today was my day.”

What he should have done next depended on the kind of bear and the type of situation, according to the Alaska Dispatch News, which summarized advice from the Alaska Department of Fish and Game and the National Park Service.

Play dead if a bear is attacking to defend itself or its cubs. Fight back if it wants you as a meal. (“For black bears, fighting back is almost always your best defense.”)

Stay calm.

Don’t climb a tree. (Brown and black bears can climb too.)

In the seconds after seeing what he said were black bears, Marube, a competitive runner who had raced the day before, had to make a quick decision.

“Either to climb up this tree or run back or run to the lake.”

But he can’t swim. And he knew bears could climb.

So he ran.

Just 20 yards back he had passed a house on the lake.

So that house would be my refuge, he thought.

“Because I wasn’t going to fight them.”

As soon as he turned, the bears gave chase, he said.

Unlike Michael Phelps’s Great White shark challenge, Marube faced greater consequences in his race.

Last month a 16-year-old runner in Alaska was chased and killed by an 180-pound male black bear after the teenager got off-trail during a race, park rangers and race officials believe. He sent a text message to a family member that he was being chased by a bear, in what experts say was a rare attack.

Of the Lower 48, Maine has about 36,000 black bears, more than any other state in eastern United States, according to the Maine Department of Inland Fisheries and Wildlife.

For Marube, the two black bears on his tail were his primary concern at the moment.

By the time he reached the unoccupied house, the bears were within 10 yards of him, Marube told the Sun Journal.

He ran up the steps, unhooked the screen door and stepped inside elevated porch. The bears came up after him.

“They could see me. I could see them,” he said.

Though they sniffed at the door, the black bears did not enter, Marube said. He watched as they went back down the steps and explored the side of the house before running off into the woods.

Marube was grateful the house was only 20 yards away, convinced that the bears would have outrun him if it were farther.

This was not his first encounter with a wild animal. Marube, who is currently a student at the University of Maine at Farmington, came to the United States from Kenya in 2010. Once on a run there, he got lost in the woods and came upon a leopard in a tree, he told the Sun Journal.

“I don’t fear lion,” he said. “I don’t fear anything else. But a bear is scary.”