Firefighters in Massachusetts, along with backup responders, spent two hours Thursday freeing a raccoon that had gotten stuck in a storm grate.

The Newton Fire Department tweeted a picture of the critter with its head sticking out of one of the grate's holes, and its paws grasping adjacent bars to support himself.

Newton Fire Lt. Phil McCully told NBC News that the department got a call about the trapped raccoon from a bicyclist riding to work.

A responding crew of four firefighters first tried to lubricate the raccoon's head with dish soap so he would "slip out," McCully said. Photos show the raccoon lathered with suds, its fur plastered to his face.

But the raccoon didn't budge, even though "this method usually works 90 percent of the time," McCully said.

So the firefighters removed the grate from the sidewalk, hoping, with the animal's feet on the ground and some leverage, the raccoon would be able to pull itself free. No dice.

The next method was to use medical gauze to compress the animal's neck and slip him free, which the department does to remove rings stuck on people's fingers.

When that didn't work, an animal control officer was called to the scene, but she was also unable to free the raccoon.

A local veterinarian then arrived to sedate the critter. With its tense neck muscles relaxed, it was finally freed from the grate.

By the end of the ordeal, 10 firefighters had joined the effort, McCully said.

"It was quite the operation," said a tweet from the Newton Fire Department. "We rescue citizens both big and small!!!"

The raccoon was taken by Waltham Animal Control for observation, and will be released into the wild when the medication wears off, McCully said.