A Dover-Foxcroft man pleaded guilty Thursday to possession of child pornography in U.S. District Court in Bangor.

William Curtis Oliver, 53, contacted a Rosenberg, Texas, detective posing as a 14-year-old girl on an internet site. In January 2016, he wrote about traveling from Maine to meet the girl and have sex. He also sent several child porn images, court records say.

Oliver faces up to 20 years in prison and a $250,000 fine on the charges, according to a statement by Acting U.S. Attorney Richard W. Murphy. Oliver, who will be sentenced at a later date, could face a mandatory minimum sentence of 10 years because he has a previous conviction on a charge of child molestation.

Oliver has been in custody since his arrest in September 2016 after federal and state authorities learned he had been convicted of child molestation in Georgia and failed to register as a sex offender after he moved to Maine in December 2015.