BEIJING  Chinese courts sentenced two men to death on Thursday for endangering public safety in a tainted-milk scandal that killed at least six children, according to state-run news media.

Three other defendants, including a top dairy company executive, were sentenced to life in prison. Another defendant received a suspended death sentence, and 15 others were given prison terms from 2 to 15 years.

The sentences were the first to be handed down in one of the worst food safety scandals in China in decades. The scandals erupted in September, prompting a global recall of Chinese-made dairy products, shaking consumer confidence and devastating the nation’s dairy industry.

Some lawyers and victims have accused Beijing of failing to regulate the nation’s dairy industry properly. Some critics believe that the government covered up the scandal until after the Olympic Games in Beijing in August.