A Canadian man survived a bear attack and months in the wilderness thanks to his faithful companion, a dog. But at the end of the ordeal, the dog didn't make it out alive.

In July, a 44-year-old man, Marco Lavoie, set off on a two-month canoeing trip in Northwestern Quebec along the Nottaway River. But a bear attacked his campsite, eating all his food and destroying the canoe he needed to travel back home. His beloved German shepherd chased off the bear before the man could be harmed.

Without any food, Lavoie faced certain starvation. So a few days later, he hit his dog with a rock and ate him. When he was late returning from his trip in October, his family alerted police. When Lavoie was finally rescued late last month, he couldn't speak or eat, had lost about 90 pounds, and was dehydrated and suffering from hypothermia.

"He survived because he made good decisions. Eating his dog was one of them," Andre Francois Bourbeau, author of a survival guide, told the Toronto Sun.

Follow Tia Ghose on Twitter and Google+. Follow LiveScience @livescience, Facebook & Google+. Original article on LiveScience.