A Sanford man who was driving a car bugged as he drove to Massachusetts and back with a supply of cocaine and heroin pleaded guilty Monday in U.S. District Court in Portland to possession of both drugs with intent to distribute.

Adam Hill, 34, had a GPS tracking device planted by the Maine Drug Enforcement Agency on his car on April 10 as he drove back from Lawrence, Massachusetts, and was pulled over by police, according to court records.

Police who searched him discovered about 43 grams of heroin and 20 grams of cocaine, the court records state.

Hill remains held in custody until his sentencing before Judge D. Brock Hornby. His sentencing date was not immediately available. He faces up to 20 years in federal prison and a fine of as much as $1 million.