When a Lake Tahoe community had an unbearable problem, California wildlife officials stepped in to help.

The California Department of Fish and Wildlife relocated a bear in September that officials said was the same animal caught on camera stealing food from a grocery store, a gas station convenience store and a birthday party. Videos from at least two of the incidents made national headlines.

The department trapped the black bear in September and matched it to early incidents from DNA, according to a Fish and Wildlife blog post. Officials brought him to the wildlife investigations lab in Sacramento and found that the bear was more than 16 years old and had a poorly healed injury on its left hind foot.

The bear’s troublemaking behavior classified it as a “habituated bear,” meaning it has become used to encountering people and having no negative consequences. Efforts to change its behavior were unsuccessful, so Fish and Wildlife officials decided to move the bear to a wilder place.

MOUNTAIN LION SNATCHES PET DOG DURING HOT SPRINGS VISIT

They released the bear “in a large expanse of wild, suitable bear habitat,” officials wrote in the blog. To make sure it doesn’t make its way back to civilization, they put a GPS tracking collar on the bear.

Fish and Wildlife shared a video of the release. Officers honk a car horn, shout and fire beanbags at the bear to scare it off into the woods.

Before its capture, the bear’s antics were well-documented. In August, surveillance video at a gas station in Kings Beach, California, recorded the bear a least three times, KOVR reported. In one incident, video shows an employee trying to scare off the bear, which snapped at the man.

“Fighting off bears was not in the job description,” he told KOVR.

CLICK HERE TO GET THE FOX NEWS APP

A few days later, a woman recorded video of the bear walking into the Kings Beach Safeway. The bear browses around inside the store before making off with a bag of tortilla chips.

“This actual bear, right there, that I almost walked into, has gone into Safeway and decided … that he is going to go shopping,” she said in the video.

CLICK HERE TO SIGN UP FOR OUR LIFESTYLE NEWSLETTER

In another incident, which apparently hasn’t made its way to social media, the bear interrupted a birthday party with about 20 people at Kings Beach State Recreation Area on the shore of Lake Tahoe, SFGate.com reported.

“The bear walked right up in the middle of everybody and sat down at the picnic table and started eating the birthday cake they had, right there,” Kevin Thomas, manager of the California Department of Fish and Wildlife’s north central region, told SFGate.com.

Wildlife officials caught the bear before it could cause any serious damage or injuries. It may have been in the nick of time. Last month, they advised Lake Tahoe area residents that it’s the time of year when bears experience hyperphagia, the increase in eating as they fatten up for the winter. Bears will eat and drink “nonstop” in order to consume 25,000 calories per day.

The California Department of Fish and Wildlife shared some advice for safe-guarding homes in areas with bears:

Store garbage in bear-resistant containers and properly close them. Never leave groceries, feed or any scented items in vehicles, as bears can open the doors and may damage them trying to get inside. Keep grills clean and stored inside when not in use. Keep doors and windows closed and locked when not home. Use electric fences to keep bears away from vegetable gardens, compost piles, orchards and chickens. Don’t put out bird feeders.