The Walgreen Company, the nation’s biggest pharmacy operator, agreed on Tuesday to pay $80 million to resolve federal charges that it failed to properly control the sales of narcotic painkillers at some of its outlets.

Officials at the Drug Enforcement Administration described the fine as the biggest ever paid by a pharmacy chain. As part of the settlement, the license of a Florida facility used by Walgreen to distribute controlled drugs was revoked for two years.

D.E.A. officials said that many of the drugs dispensed at the facility made their way to the black market, including oxycodone, a strong narcotic that is also the active ingredient in OxyContin.

Under the agreement, Walgreen committed to establish better internal controls. It acknowledged that practices at a distribution facility and some of its pharmacies in Florida did not meet standards.