The substance, chloramphenicol, is a broad-spectrum antibiotic which is forbidden in food manufacturing within the European Union.
According to Sweden's National Food Agency (Livsmedelsverket), consumers are not at risk since the levels found in the affected chocolates and wafers are very low. The items that are already out in Swedish stores will not be recalled.
Despite the EU-wide ban, chloramphenicol has been detected in food products before, including in pork.
In the Cloetta-manufactured chocolate wafer, Kexchoklad, the source of the forbidden substance was an enzyme, which is used as an ingredient.
Cloetta spokesman Jacob Broberg said the problem lay with the producers.
"Apparently our supplier has switched producers and that producer has not informed the supplier," Broberg told news agency TT.
"All our suppliers guarantee that the products contain what they should contain. We also perform regular tests of the contents," said Broberg.
"In this case, if you do not know exactly what you're looking for then it's very hard to find it. What was in the enzyme is not what we typically look for," he added.