An Atlantic County man who worked as a caseworker at the New Jersey agency that oversees child protection has been charged in federal court with producing child pornography, U.S. Attorney Craig Carpenito said Friday.

Kayan Frazier, 27, allegedly produced child pornography with a “prepubescent boy” who stayed and slept with Frazier several days a week in the man’s Somers Point apartment, according to the criminal complaint filed July 3 in federal court in Camden.

In 2017, Frazier was fired as a substitute teacher at an elementary school in Atlantic County after an investigation found that an underage male visited Frazier at his residence and slept in his bed, according to the complaint. The investigation, conducted by the state Department of Children and Families, also found that Frazier communicated by text message with a 9-year-old boy after school hours.

The complaint said that Frazier was fired from the school as a result of the Department of Children and Families investigation, which was started in March 2017. The complaint said the boy who slept in Frazier’s bed “did not disclose any sexual contact.”

Frazier “subsequently” obtained a job as a caseworker with the Division of Child Protection and Permanence in the Department of Children and Families, “in which capacity he had direct access to children,” the complaint said.

Jason Butkowski, director of communications for the department, said Frazier was hired by the department in 2017 and his title was “family services specialist 2.” Frazier was suspended with pay this year on April 15, and then suspended without pay after a civil service hearing on April 22.

Butkowski said he could not discuss department investigations because of confidentiality laws.

“We can confirm that the department performs background and CARI (Child Abuse Record Information) checks on all prospective employees, and will not offer employment to any candidate that has even been substantiated for abuse and neglect,” Butkowski said in an email.

The child pornography investigation was launched after the social media site Tumblr reported suspicious activity from an account tied to Frazier.

Law enforcement officers executed a search warrant at Frazier’s residence in April and found him in the company of the prepubescent boy who later told investigators that he stayed at the apartment and appeared in Frazier’s child pornography, the complaint said. The boy’s mother said she was unaware of Frazier’s sexually explicit contact with her son.

Investigators recovered several thousands images of child pornography from Frazier’s electronic devices, prosecutors said.

The detailed criminal complaint also includes allegations that Frazier had sexual contact with other boys and was involved in trying to sell child porn online.

Frazier was arrested on April 15 by the Atlantic County Prosecutor’s Office and charged in state court with child endangerment. He has been in custody since.

In federal court, Frazier was charged with one count each of producing child pornography, receiving child pornography, and distribution of child pornography.

A federal public defender assigned to Frazier could not be reached for comment Friday evening.