Walgreens will pay $7.5 million to settle allegations that for more than a decade it let an unlicensed pharmacist handle hundreds of thousands of prescriptions, including some for highly addictive painkillers, the authorities in California said on Monday, another setback for a company already facing broader accusations that it helped feed the opioid epidemic.

The Santa Clara County District Attorney’s Office, one of two San Francisco Bay Area agencies that sued Walgreens, said that the employee, Kim Thien Le, 44, handled more than 745,000 prescriptions, including thousands for drugs like oxycodone, fentanyl, morphine and codeine, from 2006 to 2017. She was never licensed by the state pharmacy board as required by law, the authorities said.

“Consumers depend on pharmacies to make sure that the person behind the counter preparing and giving out medical prescription drugs is trained, competent and licensed to do so,” Tiyen Lin, a deputy district attorney in the consumer protection unit at the Santa Clara County District Attorney’s Office, said in a statement on Monday. “Their lives may depend on it.”

The authorities discovered that Ms. Le did not have a license during a state pharmacy board audit in 2017. Ms. Le falsely impersonated Walgreens pharmacists and used a license of someone who had the same first name, the authorities have said.