A master sergeant in the U.S. Air Force was indicted Wednesday on charges that he sexually exploited young girls to produce child pornography after a years-long sting in which he shared the graphic images with an undercover agent, authorities said.

William S. Gazafi, 44, of Lusby, was arrested earlier this month after he shared pictures that he told the undercover agent he personally had produced, authorities said. Gazafi told the agent he molested young girls that he watched, and at least once, he had given a girl Ambien, a powerful sedative normally used to treat insomnia, according to a federal arrest affidavit.

The agent, who had been posing as another man interested in sharing child pornography , first made contact with Gazafi in August 2011, though their conversations escalated between August 2012 and August 2013, according to the arrest affidavit.

Gazafi was indicted on six counts of sexually exploiting a minor to produce child pornography, authorities said. According to the indictment, a 7-year-old girl and a five-or-six-month old baby girl were among his victims.

According to the arrest affidavit, Gazafi worked in a communications job for the Air Force and held a security clearance. Candice Ismirle, an Air Force spokeswoman, said he was assigned to Joint Base Andrews and was a member of the 89th Airlift Wing, but she could not comment on whether he had been suspended or would face military discipline.

John Chamble, an attorney for Gazafi, declined to comment.