FILE PHOTO: Lee Robert Moore is pictured in this undated booking photo provided by the Delaware Department of Justice. REUTERS/Delaware Department of Justice/Handout via Reuters

(Reuters) - A former Secret Service uniformed officer was sentenced to 20 years in prison on Thursday for sending sexually explicit messages to minors, sometimes while on duty at the White House, the U.S. Justice Department said.

Lee Robert Moore, 38, of Church Hill, Maryland, pleaded guilty in March to enticement of a minor to engage in sexual activity and attempting to transfer obscene materials to a minor. He was fired after his arrest in November 2015.

Moore was sentenced in U.S. District Court in Palm Beach, Florida, where his guilty pleas were consolidated, the Justice Department said in a statement.

When he was arrested, Moore was assigned to protect the White House complex, and prosecutors said he sent some of the materials while on duty there.

He was originally arrested on a charge of sending naked pictures of himself to an undercover Delaware State Police officer posing as a 14-year-old girl.

After his arrest, investigators found that Moore had sent sexually explicit images of himself to a minor in Florida and asked her to send him explicit photos of herself, the statement said.

He had similar communications with a 14-year-old girl in Texas and a 17-year-old girl in Missouri, it said.

Moore was sentenced to a lifetime of supervised release after his prison term is over.