Fireworks are fun, but the can cause anxiety and panic in pets.

To help comfort shelter dogs, the Brevard County Sheriff’s Office is taking jail inmates to the Animal Care Center to comfort and cuddle dogs during the Independence Day firework celebrations.

The Sheriff’s Office said in a post on its Facebook page, “This year inmates on our Chain Gang and other work crews will be comforting our dogs at the Animal Care Center by reading to them, playing with them, and even feeding them treats during the peak hours of celebration on Independence Day.”

The goal is to help calm the dogs as well as build and instill a sense of purpose and compassion in inmates before they transition back into society, the Sheriff’s Office said.

The idea came about when citizens contacted the agency asking if they could volunteer their time on the Fourth of July to comfort dogs.

“I want to personally thank everyone who offered to spend their 4th of July evening comforting our homeless pets, as we are truly blessed to have such amazing support from our community,” Sheriff Wayne Ivey said in the post. “As I always say...’it takes a community to protect a community’ and this post is a perfect example of just how true that statement is!”