A black bear was rescued after it got its head stuck in a milk can Monday in Frederick County, Md.

A picture showed the bear with its head in the can, trying to get free.

The incident began around 6:45 a.m. Monday when a homeowner near Cunningham Falls State Park called wildlife officials and said a bear was on the property with a milk jug stuck on its head. When wildlife officers arrived, they found the bear lying down with the jug on its head.

The officers tranquilized the bear, which was a male and believed to weigh between 175 and 200 pounds. They then used a small saw on the milk can and their hands to pull the jug off, according to Patricia Allen, a spokeswoman from the Maryland Department of Natural Resources.

The picture officials tweeted shows the bear with the jug on its head after it was tranquilized, Allen said.

“It was calm and relaxed,” she said. By tranquilizing the bear, she said, that made it “much easier and much safer.”

The bear was unharmed, officials said, and they watched it go on its way back to nearby woods.