Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A former Secret Service uniformed officer pleaded guilty Wednesday to charges that he sent sexually explicit messages to minors while on duty at the White House.

Lee Robert Moore, 38, was arrested in November 2015 and pleaded guilty Wednesday 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.

A booking photo of Lee Robert Moore. Federal authorities say Moore, a Secret Service agent from Maryland, sent obscene images and texts to someone he thought was a young Delaware girl, sometimes doing it while on duty at the White House. Delaware Department of Justice via AP

He was fired after his arrest and has been in custody since then.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Moore admitted Wednesday in federal court in West Palm Beach, Florida that he had a profile on on social media app called Meet24, which allows exchanging pictures and text. He ended up communicating with someone he thought was a 14-year-old girl but who was actually the creation of Delaware detectives in a child predator task force.

Related: White House Secret Service Officer Charged With Sexting ‘Teen’

"A number of the online chats between Moore and the undercover officers posing as a female minor were sexual in nature and on several occasions Moore sent pictures of himself, including one sexually explicit image," prosecutors said.

After his arrest, investigators discovered that he was sending sexually explicit pictures of himself to an actual minor in Florida and enticed the minor to send sexually explicit photos of herself to him. He admitted doing the same with a 14-year-old girl in Texas and a 17-year-old girl in Missouri.

Moore had previously asked that the charges in Delaware be transferred to the Southern District of Florida so that he could plead guilty to both charges at one time.

The sentencing date was not immediately available.