A Department of Defense police officer who was trying to meet a child online for sex was snared in a sting operation, officials said.

Matthew McMullen, 27, pleaded guilty in U.S. District Court Wednesday to traveling interstate to engage in illicit sexual conduct and enticing a minor.

On Feb. 4, McMullen, of California, Md., met an undercover officer with the FBI’s Child Exploitation Task Force on a social network site, accordng to the U.S. Attorney’s office. McMullen contacted the officer, and they communicated that day by e-mail.

During their conversation, McMullen said he wanted to have sexual contact with a child, offcials said. When McMullen traveled from Maryland to a pre-arranged meeting place in D.C., he was arrested.

His sentencing date is July 12, and he faces a maximum sentence of 30 years and a $250,000 fine. Under federal sentencing guidelines, he faces a likely sentencing range of about four to five years.