The U.S. Department of Justice on Friday dismissed all criminal charges against FedEx Corp. in a case where the company was accused of shipping packages from illegal online pharmacies despite repeated warnings, according to a court filing.

Trial had begun earlier this week in San Francisco federal court, and FedEx faced a potential $1.6 billion in penalties.

A Justice Department spokesman declined to comment on the reasons for the abrupt dismissal.

In a statement, FedEx spokesman Patrick Fitzgerald said the company has always been innocent and the case should never have been brought.

"The government should take a very hard look at how they made the tremendously poor decision to file these charges," Fitzgerald said. "Many companies would not have had the courage or the resources to defend themselves against false charges."

According to the indictment, FedEx was warned "on no less than six different occasions" that illegal Internet pharmacies were using its services to distribute prescription drugs. Senior managers were among those who received warnings, the filing said.

However, in court this week U.S. District Judge Charles Breyer said FedEx was "factually innocent" and had offered to cooperate with the government during its investigation, according to the Recorder, a California legal publication.