Wildlife officials in Colorado shot and killed bear after it attacked two men illegally camping at a site near downtown Durango.

The Durango Herald reported that Joshua E. Barber, 21, and several others, were camping at an illegal site Sunday night when the bear attacked and bit him in the head and neck. He was hospitalized and is now recovering.

A fellow camper, Robin Derendy, 33, told authorities that the animal also tried attacking him through his tent but he fought it off with a knife and it ran away. Another camper said that a fox had recently been inside one woman’s tent before being chased off.

Officials said that the way some of the sites were left with trash and food laying all over is the reason the animals came as close as they did.

“I was just up there. It was disgusting. There were piles of garbage and cans of food,” said Joe Lewandowski, a spokesman for Colorado Parks and Wildlife.

Whenever you leave out food and trash there is always a chance of attracting animals in search of a quick meal.

For more daily news stories follow Michelle on Twitter @PhilaMichelle