A 400-pound bear had to be euthanized after it was found in a Colorado restaurant’s dumpster earlier this week.

On Wednesday, the Colorado Parks and Wildlife (CPW) Southeast Region tweeted about the incident that happened in Woodland Park, Colorado.

According to the agency, the bear was able to get into the restaurant’s trash because the dumpster wasn’t locked.

WINNER OF ‘FAT BEAR WEEK’ COMPETITION CROWNED BY ALASKA NATIONAL PARK

Bill Vogrin, a CPW public information officer, told Fox News that the bear -- which was estimated to be between 18 and 19 years old -- was first found in the dumpster around midnight, but wildlife officers hoped the bear would find its way out overnight.

However, when an officer returned to the dumpster in the morning, the bear was still inside and was struggling to get out.

After wildlife officers tranquilized it and tipped the dumpster over, they saw the bear was having trouble breathing and “was in serious distress,” Vogrin said.

ANGLER REELS IN RARE 364-POUND ‘SUPER COW’ BLUEFIN TUNA IN CALIFORNIA

The officers determined the bear was probably too old to recover, so they “humanely euthanized” the bear and performed a necropsy -- or autopsy -- right there.

“Its stomach was full of garbage, a lot of plastic,” Vogrin said. “[It] was suffering from having spent the night gorging itself in this garbage.”

This 400-pound bear had to be euthanized after it was found struggling to get out of a dumpster in Woodland Park, Colorado, on Wednesday morning. (Colorado Parks and Wildlife)

This 400-pound bear had to be euthanized after it was found struggling to get out of a dumpster in Woodland Park, Colorado, on Wednesday morning. (Colorado Parks and Wildlife)

BEAR STEALS FOOD FROM CAR, LEAVES BEHIND HAIR, MUDDY TRACKS

Vogrin said the restaurant has never been cited for leaving its dumpster unsecured before, so it will not be fined.

“But they are being cited with a written warning and we’ll be watching them because really, there’s no excuse for this up here,” he said.

CLICK HERE TO GET THE FOX NEWS APP

“We preach this constantly,” Vogrin said. “‘Garbage kills bears’ is one of our catchphrases.”

He added that securing garbage is especially important for residents and businesses in the fall months because bears are going through something called hyperphagia, which is an increase in feeding that happens as they prepare for hibernation.

CLICK HERE TO SIGN UP FOR OUR LIFESTYLE NEWSLETTER

Vogrin said during hyperphagia, bears eat 20 hours a day and are trying to consume 20,000 calories a day. Unsecured dumpsters are easier places for bears to get those calories than their typical diet of berries and acorns -- but the garbage inside is also deadly.

“It’s a human problem,” Vogrin said. “It’s not a bear problem. We don’t have bad bears, but we have bad humans teaching bears bad habits, to look to humans for food.”

FOLLOW US ON FACEBOOK FOR MORE FOX LIFESTYLE NEWS