In a video released by the sheriff's office, officers are seen surrounding the vehicle while waiting for the bear to escape through the trunk they opened.

As the bear seized its opportunity, it emerged from the rear of the car and darted away.

"There you go, buddy," said one officer as the unharmed bear sprinted into the nearby trees.

To help other residents of Boulder avoid circumstances like this, the sheriff’s office recommended a list of tips, saying, "Trust us, you don’t want to have to deal with a 'hangry' bear."

Some tips included storing garbage in bear-resistant containers to emptying their cars of sun-tan lotion, hand cream and food wrappers, keeping garage doors closed and locking the door between the garage and the home.