A Saco man who led police on a foot chase this summer after stealing oxycodone from a drugstore on Main Street in Saco pleaded guilty Friday to a federal charge of pharmacy robbery.

William C. Day, 40, changed his plea to guilty in U.S. District Court in Portland before Judge Nancy Torresen 10 days before his case was scheduled for trial, according to court records.

Day vaulted the counter at the rear of Community Pharmacy on the afternoon of Aug. 10 and told the three employees there that he was robbing the store, Assistant U.S. Attorney Jonathan Chapman said in a prosecution document filed with the court.

“Day instructed the employees to put their hands on the counter and then instructed the pharmacist to give him narcotics,” Chapman wrote in the prosecution document. “The pharmacist complied, placing one full bottle and one partial bottle of oxycodone in a brown paper shopping bag. Day then said that he wanted more drugs and specified Percocet.”

While Day was robbing the drugstore, an employee there triggered a silent alarm. Saco police officers spotted Day after he left the pharmacy and chased him to School Street, the court document states.

“There, they apprehended Day as he was crouched in some bushes. Scattered on the ground near where Day was arrested were numerous stolen pills as well as the brown shopping bag into which the pharmacist had placed the drugs during the robbery,” Chapman wrote.

In total, Day stole 1,594 oxycodone and oxycodone-acetaminophen pills worth $759, court records state.

Day’s sentencing date has not yet been set. He faces up to 20 years in federal prison and a fine for as much as $250,000.