A Warminster police officer acted as a “wolf in sheep’s clothing” and sexually assaulted four teenage boys he knew were dealing with difficulties at home, Bucks County District Attorney Matthew Weintraub said Wednesday.

More than 30 years after the initial alleged attacks, James Carey was arrested Wednesday and charged with felony sexual abuse.

“A police officer’s creed is to protect and serve his community,” Weintraub said. “In a perverse and cruel dereliction of duty, James Carey took advantage of the rank and credentials he had as a police officer on the job to prey on our community’s most vulnerable.”

Carey, 52, met his victims between 1988 and 2000, when he worked as an officer in the D.A.R.E antidrug program at schools in the Centennial School District in Warminster, Weintraub said. But he had access to victims beyond the schools, including on overnight camping trips to the Poconos and to Camp Ockanickon, a Boy Scout facility in Pipersville, the district attorney said.

Carey was investigated in 2001 and again in 2006, as rumors swirled among teenagers and their parents that he behaved too jocularly around male students, sometimes inviting them into his hot tub or asking them to spend time with him, alone, at his home in Warminster.

But no charges were filed until Wednesday, when Carey was arraigned on statutory sexual assault, involuntary deviate sexual intercourse, corruption of minors, and related offenses. He was arraigned before Magisterial District Judge Maggie Snow and released on 10% of $100,000 bail.

Carey’s attorney, Michael Applebaum, said Carey “completely denies the allegations and looks forward to defending himself in court.”

The investigation into Carey’s behavior gained momentum in May, Weintraub said, when a now-adult victim came forward to report that he had been molested by Carey at a rec center in the township, according to the affidavit of probable cause for Carey’s arrest.

The man said Carey, whom he knew through the D.A.R.E program, followed him into the bathroom and told him he needed to search him after finding a bag of marijuana, the affidavit said. During an invasive pat-down, he said, Carey groped him and forced him to perform a sex act.

The three other victims, prosecutors say, told a Bucks County grand jury that Carey acted as a father figure, making excuses to spend time with them alone, and then groped them or forced them into sexual encounters.

“The grooming tactics he used were pervasive, manipulative, and calculated such that he not only lowered the minor’s guard but also attempted to provide an assurance that his crimes would go unreported and if reported, not believed,” prosecutors wrote in court documents.

A concerned parent contacted Warminster police in 2001, sparking an investigation by then-District Attorney Diane Gibbons. The investigation did not yield criminal charges, but Gibbons wrote a letter to Warminster police, detailing her concerns about Carey’s behavior.

Still, Carey remained on the force until 2005, when he was fired for mishandling cases unrelated to the accusations he faced. He won his job back through arbitration, and retired in 2009, prosecutors said.

He moved to Cape May County, where he now lives. Shortly after winning his job back, Carey got another job working as a caretaker at a campground in Cape May County. He lost that position as well, amid allegations that he had inappropriate contact with minors, court documents said.

Though New Jersey State Police investigated Carey for those allegations, no criminal charges were filed.

Another alleged molester, Charles Goodenough, was connected to Carey through Camp Ockanickon and the Warminster Fire Department’s Explorer Program. Separate victims told investigators Goodenough showed them pornography at the camp, urged them to skinny-dip with him, and, in some cases, groped them at his home in Warminster.

Goodenough, 60, died by suicide in March, days after detectives served a search warrant on his home in connection with that investigation.

Weintraub on Wednesday praised the bravery of the four men who came forward, saying without them, the charges would never have been filed. He said he believed there may be more victims of Carey’s abuse, and urged them to contact his office.

“If you or someone you know was molested by this man, please come forward,” Weintraub said. “We will help you get justice. We can help you heal.”

This story has been corrected from an earlier version that misidentified the location of Camp Ockanickon.