The U.S. Consumer Product Safety Commission can't let toys containing toxic manufacturing chemicals remain on store shelves after a ban takes effect next week, a judge ruled Thursday.

U.S. District Judge Paul Gardephe said the commission, whose role is to protect the public from dangerous goods, must eliminate a loophole that lets the substances remain in toys made before the ban is in place Tuesday.

Manufacturers have said they would have to pull hundreds of millions of dollars' worth of products from store shelves to comply, but consumer advocates called the ruling a victory for children's health.

CPSC spokesman Joe Martyak said the commission decided not to appeal the ruling, which relates to phthalates, chemicals used to soften plastics. They are commonly found in bath toys, books, teethers, bibs, dolls and plastic figures.

Phthalates can be absorbed through the mouth or skin, interfering with reproductive hormones.

A federal law signed last summer bans the chemicals from toys.

Two consumer advocacy groups, Public Citizen and the Natural Resources Defense Council, sued the CPSC in December. They said the agency created a loophole by saying the ban didn't apply to toys or child-care products manufactured before Feb. 10.

Attorney Aaron Colangelo, who argued the case for the NRDC, described the ruling as "a big win for children's health and for consumer safety.

"Without this ruling, consumers buying toys after Feb. 10 would have no way of knowing whether they contain phthalates or not," he said.

The judge's ruling said the text of the law banning phthalates "provides unequivocally and unambiguously that no covered products may be sold as of Feb. 10, 2009."

"Unless another section of the statute can be read as creating an express exception for existing inventory," he continued, "the commission may not interpret the phthalate prohibitions as containing such an exception."

Colangelo said phthalates already have been banned in some places around the world, so phthalate-free products are already available to toy companies.

"It won't be hard for them" to comply, he said.