A Westbrook man who emailed a sexually explicit image of a young girl to an undercover federal agent last year while pretending to be her mother pleaded guilty on Wednesday to two federal charges.

Michael Van Eekhout, 51, had been scheduled to stand trial next month in U.S. District Court in Portland when he decided to plead guilty before Judge Jon Levy to charges of transporting child pornography and transmitting an extortionate threat.

Van Eekhout used the identity of a woman with whom he had once worked in New Hampshire to create an email account from which he sent images of the woman’s daughter, both clothed and nude, according to an affidavit filed with the court by David Fife, a federal agent with Homeland Security Investigations.

Van Eekhout pretended to be the woman while he developed email correspondents whom he found using the website Craigslist, Fife said in the affidavit unsealed after Van Eekhout’s arrest last August.

“In these emails, it appeared that Van Eekhout was posing as a mother with a 10- or 11-year-old daughter, and many featured clothed or nude images of (the woman) and/or clothed images of (the woman’s) actual daughter,” Fife wrote in the affidavit.

Van Eekhout is accused of emailing Fife a pornographic image of the child on July 15, 2014, leading federal agents and Westbrook police to execute a search warrant at Eekhout’s home at 272 Cumberland St. on July 18, 2014.

Van Eekhout initially denied involvement in child pornography, but later admitted sending the images in the woman’s name. Authorities accessed his online accounts to verify that he had sent the emails, Fife wrote.

He faces a sentence of five to 20 years in prison, a maximum fine of $250,000, and supervised release of up to life on the child pornography charge. He faces a sentence of up to two years in prison, a fine of up to $250,000, and supervised release of up to one year on the threat charge. His sentencing date was not immediately available.