A Prince George, B.C., man is thanking his dog after narrowly escaping an attack by a black bear with cubs.

Reid Roberts and his dog Pacer were running in Forest for the World Provincial Park near the University of Northern B.C. Tuesday, when they startled a mother black bear and two cubs who were in the bushes at the side of the trail.

"She didn't hear us coming and we didn't know she was there," said Roberts. "She had no choice but to come out immediately and go into attack mode."

Roberts was lucky to escape with a punctured hand, claw scratches and some bruises. (Reid Roberts)

Roberts, 46, described the attack on Facebook.

"I was yelling hard and waving my hands as I was backing up. I never wanted to 'turtle' and knew I had to fight," he wrote. "I'm not sure how I ended up on the ground … but I remember [the bear] swatting at me. I just started kicking at her while I was on my back."

Roberts says Pacer managed to momentarily distract the bear by barking and biting it. That gave him just enough time to scramble behind some bushes.

'This is not good'

But then the bear charged for a second time.

"I remember thinking, 'Really? She's coming again? This is not good.'"

Once again, Pacer came to the rescue, attacking the bear, this time managing to lead it down the trail away from Roberts, who was bleeding badly.

After attempting to climb a tree, Roberts phoned 911 and staggered back to the parking lot.

"I saw that my hand was gushing out blood, but the rest of me was OK," he said.

Roberts was treated in hospital for the gash on his hand, which required 16 stitches. His other injuries — claw scratches, cuts and bruises — are mostly superficial.

'Pacer is my hero'

Pacer also managed to escape unharmed. He turned up two kilometres away at a friend's house later that day.

"Pacer is my hero," said Roberts, who plans to return to trail-running as soon as possible. "He'll put a chase on a bear or a moose to allow me to continue to run safely. He's a great running partner."

The female bear has been euthanized. The two cubs were tranquillized and transported to a wildlife shelter in Smithers.