A Johnson & Johnson subsidiary plead guilty to selling liquid medicine contaminated with metal on Tuesday.

The company has agreed to pay $25 million to settle the case, the U.S. Department of Justice said according to Reuters.

McNeil Consumer Healthcare was the subsidiary that pleaded guilty to one federal criminal charge in the case.

Prosecutors say that McNeil knew about the problem with metal in the children's drugs for more than a year but failed to act quickly to fix the problem. The company acknowledges failing to take quick action, according to the Associated Press.

Back in 2010, the company recalled massive amounts of children's over-the-counter medicines such as Infants' Tylenol and Children's Motrin, both made at the company's Fort Washington, Pennsylvania plant.

Those were not the first recalls. The company began multiple recalls from 2008 to 2010. Hundreds of millions of bottles and packages of brands like Tylenol, Motrin, Rolaids, Benadryl and other products were recalled because of faulty manufacturing. These recalls kept popular medicines like Children's Tylenol off store shelves and hurt Johnson & Johnson's reputation.

Metal particles got into liquid medicines and moldy odors and labeling problems also caused recalls. On the label for Sudafed, the instructions repeated "not" to read: "do not not divide, crush, chew or dissolve the tablet."

The metal particles problem began in 2009 when a consumer reported seeing "black specks" at the bottom of a bottle of Infants' Tylenol. Those specks turned out to be nickel and chromium particles.

By 2010, consumer product sales for Johnson & Johnson in the U.S. had fallen by more than 19 percent, a decrease of more than $900 million. All of the recalls were a big reason why the company reported back-to-back sales declines in 2009 and 2010 for the first time since World War II.

A McNeil Consumer Healthcare spokeswoman said that the plea agreement "closes a chapter" and the company has been installing better quality and oversight standards throughout the entire business.

More safety measures will be installed before McNeil reopens its Fort Washington plant.