A U.S. Secret Service officer has pleaded guilty in federal court to ‘sexting’ underage girls while working at the White House, a Department of Justice press release has revealed.

On Wednesday, CBS reported that Lee Robert Moore, 38, a Maryland resident,  pleaded guilty to one count of enticement of a minor to engage in sexual activity and one count of attempting to transfer obscene materials to a minor. His plea was announced by U.S. Attorney Wifredo A. Ferrer of the Southern District of Florida and Acting Assistant Attorney General Kenneth A. Blanco of the Justice Department’s Criminal Division.

Moore’s activity was discovered through an undercover sting operation, conducted by Delaware State Police, who used social media applications “Meet24” and “Kik” to create fake profiles and pose as a 14-year-old girl.

Moore told Senior U.S. District Judge Daniel T.K. Hurley that he understood the implications of pleading guilty to the charges, including ending his career in law enforcement and facing a maximum punishment of life in prison.

Detectives with the Delaware Child Predator Task Force “created a profile on this site, posing as a 14-year-old girl, with whom Moore engaged in a number of online chat sessions” which were sexually explicit, the Dept. of Justice said in a media statement.

According to Moore’s plea, he used social media to chat with underage girls, soliciting them to send explicit images of themselves, as well as sending them sexually explicit photos of himself while at work.

Moore was assigned to the White House at the time of his arrest in November 2015.

Moore began sending the inappropriate texts and messages in 2014, to a Broward County girl who had just turned 16 at the time, prosecutor Corey Steinberg said in September.

After his arrest, Moore “continued communication with minors in Florida, Texas and Missouri,” the prosecutor said.

He has since been terminated from the Secret Service office.

“U.S. Immigration and Customs Enforcement’s Homeland Security Investigations and the Delaware Child Predator Task Force investigated the case.  Trial Attorney Austin M. Berry of the Criminal Division’s Child Exploitation and Obscenity Section (CEOS) and Assistant U.S. Attorney Corey Steinberg of the Southern District of Florida are prosecuting the case.

This case was brought as part of Project Safe Childhood, a nationwide initiative to combat the growing epidemic of child sexual exploitation and abuse, launched in May 2006 by the Department of Justice,” the press release said.