A Massachusetts man who unwittingly emailed sexually explicit images of a child to an undercover federal agent in Maine pleaded guilty Friday in U.S. District Court in Portland to a charge of transportation of child pornography.

Matthew McElroy, 39, of Chicopee, Massachusetts, was ordered by Judge Nancy Torresen to remain in federal custody, as he has been since his arrest on Feb. 9. He is scheduled to be sentenced on Aug. 8, when he faces between five and 20 years in federal prison.

McElroy sent an email on Jan. 21 to an undercover agent, David Fife of the Department of Homeland Security, that had several attached images of child pornography, according to court records.

Fife later executed search warrants to examine the contents of one of McElroy’s email accounts and discovered more images of child pornography, court records state.

McElroy was arrested on a warrant in Massachusetts and later transported to Maine to face the charge.

Scott Dolan can be contacted at 791-6304 or at:

[email protected]

Twitter: @scottddolan