WILMINGTON, Del. — A Secret Service officer charged with trying to solicit a 14-year-old girl for sex made an initial appearance Monday in federal court, where he was told he could face 10 years in prison if convicted of trying to transfer obscene material to a minor.

The hearing was held just hours after Lee Robert Moore, 37, was released from a Delaware state prison into the custody of U.S. Marshals.

Magistrate Judge Sherry Fallon agreed to appoint a federal public defender to represent Moore, who posted $105,000 secured bond last week on separate state charges of sexual solicitation of a child under 18 and providing obscene material to a minor.

Fallon scheduled a preliminary hearing for Thursday, when she will consider a motion by federal prosecutors to detain Moore pending trial.

Moore surrendered to authorities in Maryland on Nov. 9 after being caught in an undercover online sex sting by Delaware State Police.

His arrest brings new scrutiny to a federal agency already reeling from a series of scandals stretching back to 2012, when more than a dozen agents and officers were implicated in hiring prostitutes during a South American presidential trip. Since then, multiple agents and officers have been accused of wrongdoing. Former agency director Julia Pierson was ousted last year after the disclosure of two security breaches, including an incident in which a man with a knife scaled a White House fence and ran deep into the executive mansion.

According to a federal complaint unsealed last week, Moore often engaged in online chats while on duty at the White House, once asking an undercover officer who he thought was a 14-year-old girl to send him something “exciting” on a day when he was checking IDs for a building entrance.

The Secret Service issued a statement saying Moore’s security clearance was suspended Nov. 6, the same day the matter was reported to its Office of Professional Responsibility.

Delaware State Police Detective Kevin McKay said in an affidavit that Moore connected with him using two social media applications while McKay was posing online as a 14-year-old girl.

“He stated he wanted to travel to Delaware and meet in person for sex. Moore made it clear that he knew I was a 14 yr old girl,” McKay wrote.