(CNN) -- Two people were executed Tuesday in China for their part in a tainted milk scandal that killed at least six babies and sickened about 300,000 others, state-run media reported.

Zhang Yujun was executed for endangering public safety and Geng Jinping was executed for producing and selling toxic food, the Xinhua news agency said.

The tainted formula came to light in September 2008, after several babies fell ill from drinking formula that contained melamine. Melamine is commonly used in coatings and laminates, wood adhesives, fabric coatings, ceiling tiles and flame retardants. Some Chinese dairy plants added the chemical to milk products so they would appear to have a higher protein level.

The tainted milk caused kidney stones and urinary tract problems in hundreds of thousands of children.

The 22 Chinese dairy producers that made the formula have offered compensation to victims' families.

In all, 21 people were tried and sentenced in January for their roles in the scandal, Xinhua reported. Among them, Zhang and Geng were sentenced to death, and most others received at least 15 years in prison.