An Attleboro, Mass., family rescued a whitetail deer that wedged its hind legs between the slats of a backyard fence, pinning its chest and head to the ground.

Grant Kelley, 7, said the encounter started Saturday when Dixie, the family dog, wouldn’t stop barking in the backyard. He went outside and immediately noticed something on the fence.

“We looked outside and we thought it was two huge branches but then we looked on the other side and we saw a huge head,” he told NBC affiliate WJAR. “Probably just jumped over here and got caught didn’t make it all the way over there.”

His father, officer Brian Kelley, arrived home shortly after from his night shift and tried to help the animal.

“I started to pet the back of the deer to calm him down cause he was kicking,” he said. “I started to gently free the bottom legs first, release the pickets and then was able to move the deer gently off the top of the fence.”

Brian’s wife Kate stood at a safe distance and filmed the rescue effort. Once free, the deer was able to get on its feet and run toward the forest.