BANGOR — A man from Dexter pleaded guilty Tuesday in U.S. District Court to robbing a Rite Aid Pharmacy in Guilford more than two years ago.

U.S. Attorney Thomas Delahanty II, citing court records, said Michael Thompson, 27, entered the pharmacy wearing a bandana, a hood, sunglasses and gloves on March 10, 2012. Thompson jumped over the counter, showed a large hunting knife and demanded narcotics from the pharmacist. The pharmacist opened the locker where the drugs were stored, and Thompson filled his backpack with more than $500 worth of drugs.

Thompson will be sentenced after an investigation into his background by the U.S. Probation Office. He could face as much as 20 years in prison and a fine of as much as $250,000.