An Augusta man pleaded guilty Thursday to a federal charge of possessing and intending to distribute heroin and fentanyl.

Shawn Figoli, 44, was in U.S. District Court on Thursday in Portland. His case had been scheduled for the May trial list there.

The plea to the charge was accepted by Judge Jon Levy, and a sentencing hearing will be set later.

Figoli is represented by attorney Molly Butler Bailey.

Figoli was arrested May 17, 2015, at the Kennebunk rest area on Interstate 95. A Maine State Police trooper, investigating a report that a vehicle had been operating erratically, found Figoli alone in the parked pickup.

The trooper seized 18 packages contained in a fanny-style bag, and a laboratory examination of two found they contained heroin and the opioid medication fentanyl, according to court documents filed by the prosecutor, Assistant U.S. Attorney David B. Joyce.

Figoli remains in custody.

Conviction on the charge carries a maximum penalty of 20 years in prison.