A former Department of Homeland Security press aide pleaded no contest Tuesday to charges that he had sexually explicit online conversations with someone he thought was a 14-year-old girl.

Brian J. Doyle, 56, could face up to five years in prison under the plea agreement accepted Tuesday. He also faces up to 10 years' probation at sentencing scheduled for Nov. 17, and must register as a sex offender. He resigned from the department shortly after his April 4 arrest.

"I just want to say one thing. I am very, very sorry. Very sorry," Doyle told reporters outside the Polk County courthouse.

Click here to read the original charges filed against Doyle.

Doyle, of Silver Spring, Maryland, could have been sentenced to up to 115 years in prison if convicted of the 23 felony charges, which included 16 counts of sending pornographic movie clips to a minor.

Prosecutors said Doyle wrote "very graphic" descriptions of sexual acts in online chats with a 14-year-old named "Ashlynne," who was actually an undercover Polk County sheriff's detective. Doyle was arrested after detectives said he tried to set up a meeting in Florida with the girl on a date when she would not be menstruating.

According to court records, Doyle bragged about his government connections, provided his government-issued phone numbers, showed off his department ID and may have used his official computer in the communications with the detective posing as the girl.

Authorities said he sent her pornographic movie clips, as well as non-sexual photos of himself. One photo, released by the sheriff's office, shows Doyle in what appears to be Homeland Security headquarters. He is wearing a department pin on his lapel.

Doyle told detectives he was not attracted to children, but had explicit conversations as a "kind of a power trip," court documents show.

Doyle's attorney, Barry Helfand, said his client suffers from depression and would detail the reasons for his online relationship at the sentencing hearing.

His arrest sparked a national debate about Department of Homeland Security hiring practices. DHS Secretary Michael Chertoff said he did not believe Doyle's alleged misconduct resulted in a breach of national security, calling it an individual's "misstep."

Doyle joined the federal government as a civil service employee shortly after the Sept. 11, 2001, terror attacks, working at the Transportation Security Administration. He previously worked, for 26 years, as a reporter at Time magazine in Washington.

He moved to Homeland Security's press operation in the summer of 2005 and was the fourth-ranking spokesman at the agency at the time of his arrest.