It’s a dog-gone shame.

A stranded hiker was forced to eat the beloved pooch who saved his life after nearly starving to death in the Canadian wilderness.

Marco Lavoie, 44, gobbled up his German shepherd after a bear destroyed his canoe and food supply — leaving him 500 miles outside Montreal for three months, according to the Canadian news agency QMI.

The dog chased away the bear, rescuing its master — but Lavoie killed his loyal friend with a rock three days later after struggling to find food, a source told QMI.

Survival experts praised the outdoorsman for using reason in an extreme situation, explaining that food is scarce in the frigid northern climate — and he might have become too weak to overpower the dog if he had waited longer.

“He survived because he made good decisions. Eating his dog was one of them,” said survival-guide author André François Bourbeau.

“Hunger squeezes you so much that you would accept food that’s not normally possible,” Bourbeau said.

There are only a few edible plants in the area, located near the Nottaway River, but starvation generally doesn’t strike for 30 days — which animal lovers were quick to point out, claiming the hiker had chowed down on his furry friend far too soon.

“He killed and ate his dog (who had saved him) after 3 days. Then he survived another 3 months. Dog didn’t need to die,” tweeted @Gerry Dales.

Added @AmeliaRose, “This is vile. I’d rather die than kill and eat my dog to stay alive.”

Lavoie was rescued by helicopter Wednesday. He had lost 90 pounds, nearly half of his body weight, and was suffering from hypothermia.

He is now in critical condition.

Lavoie is an experienced outdoorsman, who has often spent weeks in the wilderness alone.

But the Nottaway River area is considered too dangerous even for seasoned hikers.

Lavoie’s family reported him missing only a few weeks ago because he had planned to be gone on a months-long outdoor adventure.

The bear ate Lavoie’s food in mid-July near James Bay.

Survival expert Caleb Musgrave said the human body does strange things when it is starving.

“Your mind breaks, and you cramp up all over your body. Eventually, your body will start cannibalizing itself.”