BANGOR, Maine — The first person facing a federal drug charge in Maine related to bath salts waived indictment Friday and pleaded guilty.

Shayne Ellis, 30, of Brewer also admitted to robbing a Caribou pharmacy last year and violating federal gun laws, according to the U.S. attorney’s office.

In October, the U.S. Drug Enforcement Administration banned the three major components of the synthetic drug “bath salts.” Possessing or selling the drugs, which in Maine are sold under names such as monkey dust, Rave-on and Kryptonite, became a federal felony throughout the nation.

Assistant U.S. Attorney Joel Casey declined Friday to say why Ellis was being prosecuted federally.

It is the practice of the U.S. attorney’s office not to comment on pending cases until after they have been resolved.

On Friday, Ellis pleaded guilty to conspiracy to possess with intent to distribute a controlled substance, being a felon in possession of a firearm and robbery of controlled substances from a U.S. Drug Enforcement Administration-registered pharmacy.

By pleading guilty, Ellis admitted that he was part of a drug conspiracy between Jan. 1 and Nov. 27, 2011, that distributed methylenedioxypyrovalerone, also known as MDPV, a component used to produce bath salts. He also admitted to conspiring to distribute oxycodone and hydrocodone, both powerful painkillers, and suboxone, a drug used to treat people addicted to painkillers, according to the prosecution version of events to which Ellis pleaded guilty.

Those charges stemmed from separate arrests in Brewer on Nov. 4 and Nov. 22, the prosecution version stated. In the first instance, he was found with a large amount of diverted prescription drugs and $1,450 in cash. After posting bail on state drug charges on Nov. 4, he was arrested again less than three weeks later in a Brewer motel room with a large amount of bath salts, $3,469 and a .38-caliber revolver.

Ellis posted bail again and apparently went to Aroostook County, where he and Amy Geroux, 24, of Bangor robbed the pharmacy at the Rite Aid in Caribou about 11:25 a.m. Nov. 27, police said. They were captured within a few minutes, according to previously published reports.

Items recovered included $2,500 worth of prescription painkillers and a $1,000 in merchandise — mostly jewelry and high-end liquor, Caribou Police Chief Michael Gahagan said in November.

Ellis and Geroux were charged in Washington County Superior Court in connection with the robbery. Geroux has not been charged in federal court.

Now that he has pleaded guilty to federal charges, state charges against Ellis pending in Penobscot and Washington counties are expected to be dropped.

A sentencing date for Ellis in federal court has not been set.

By pleading guilty, Ellis also agreed to forfeit the gun and nearly $5,000 in cash seized by police.

He faces up to 20 years in federal prison on the drug and robbery charges and up to 10 years in prison on the gun charge. He also faces fines of up to $2 million on the drug charge and up to $250,000 on the gun and robbery charges.

In his plea agreement with federal prosecutors, Ellis agreed to waive his right to appeal his case to the 1st U.S. Circuit Court of Appeals if the sentence imposed is less than 10 years.