No charges will be filed against a man who posted online a photo of his young son holding what appeared to be a military-style rifle, police said Wednesday.

In a moment of heightened sensitivity around guns and gun control, the brief saga had the makings of a debate starter between people who oppose guns and those who say authorities are overzealous about even legal weapons.

Police in Carneys Point, a town of 8,000 some 30 miles southwest of Philadelphia, gave their version Wednesday, days after the boy’s father, Shawn Moore, brought attention to the issue, saying that state child welfare workers and police in SWAT gear showed up at his home because of the online photos.

Moore first posted a comment about the incident on a gun rights website and within days was appearing with his son, Josh, on a Fox News talk show and elsewhere. Moore said that the weapon was a .22-caliber rifle made to look like an assault rifle and that it was a gift for Josh’s upcoming 11th birthday.

In a statement, Carney Point Police Chief Robert DiGregorio and Mayor Richard Gatanis said officers went to the family’s home at about 8:15 p.m. Friday after getting anonymous tips that a boy there might have access to weapons and ammunition.

“In light of some of the recent school shootings across our nation, the Carneys Point Police Department takes these types of calls seriously,” they said, adding that they were obligated to go there with state Department of Children and Family caseworkers who requested assistance.

Moore had said the authorities requested to see his weapons, but with his lawyer on a speakerphone he denied them access because they did not have a search warrant.

The Carneys Point officials said the officers — in night uniforms and body armor but not SWAT gear — did not attempt an unlawful search.

The officials said that they respect citizens’ rights to own weapons and that several officers knew the elder Moore from a shooting club.

Moore’s lawyer, Evan Nappen, said the problem is the idea that the government could respond to people talking about or with photos of weapons on social media.

“This is a shame because of the impact it has on a really good dad and his son,” Nappen said. “No one was in danger.”

He said the state Department of Children and Families was aggressive and intimidating and could have avoided the situation by calling first.

A department spokesman did not return calls Wednesday, but said Tuesday —without commenting on the specific case — that the department routinely checks on tips it receives.

The department has been under years of court-monitoring and has been criticized in several cases where children who died or were in peril were not checked on.