A manufacturer of over-the-counter infant’s and children’s liquid medications has agreed to pay $25 million and plead guilty to a federal criminal charge that it sold products that contained metal particles.

Court documents unsealed Tuesday say McNeil Consumer Healthcare, a unit of health care giant Johnson & Johnson, will acknowledge selling adulterated bottles of Infants’ and Children’s Tylenol and Children’s Motrin.

The documents say metal particles, including nickel, iron and chromium, were introduced during the manufacturing process. Prosecutors said McNeil failed to take immediate steps to fix the problem before eventually issuing a recall in April 2010. The Food and Drug Administration had advised consumers to stop using the medicine, even though the potential for serious medical problems was remote.