A federal judge ruled yesterday that the Consumer Product Safety Commission acted "arbitrarily and capriciously" in banning only the sale of children's nightwear treated with the flame-retarding chemical Tris.

U.S. District Court Judge George Hart said the ban should also apply to the use of the chemical -- a suspected cancer causing agent -- and to any "fabric, yarn or fiber containing Tris which is used or intended for use in children's wearing apparel."

The ban should apply "whether the fabric, yarn, or fiber is cut, uncut or already incorporated in children's apparel," Hart said. He gave the commission 10 days to comply with his order. Failure to do so would result in an injunction against the ban, he said.

The effect of the judge's order is to spread the burden of loss caused by the commission's April 8 order, which recalled from store shelves all children's nightwear treated with Tris.

Representatives of the nation's $400 million sleepwear industry charged that the ban unfairly penalized their companies with an estimated $200 million loss in revenues and a loss of thousands of jobs.

Hart agreed, ruling that the commission should not "place the whole ultimate economic burden upon the manufacturers of children's nightwear containing Tris."

However, Hart left open the question to what extent all parties -- chemical firms, textile and apparel manufacturers, and retailers -- should share liability for putting Tris-treated products on the market.

Speaking from the bench, he said: "Everybody in the whole chain is the victim, from the Tris manufacturer on down."

Consumer Product Safety Commission officials said yesterday they would withhold comment on Hart's order until they have had a chance to work on a revision of the ban. Commission lawyers and attorneys for the American Apparel Manufacturers Association were scheduled to meet with the judge today to begin working on a compromise.

The AAMA filed suit last week charging that the commission had improperly defined "hazardous substance" and "manufacturer" in issuing its ban. In its motion, the AAMA cited affidavits from 11 makers of children's sleepwear who said they could go out of business if they were forced to buy back $200 million worth of products.

Hart granted them a hearing.

Lawyers for the apparel manufacturers were jubilant when the hearing ended yesterday.

"That was the first round and we won it completely," said Louis Nizer, and AAMA attorney. "The definitions put forth by the commission that we've been opposing have been rewritten completely . . . Now all we have to do is figure out how to share the repurchase [recall] costs," Nizer said.

"Essentially, what the judge did was to order the commission to extend the ban," said Walter Pozen, a lawyer for the Independent Cutters and Sewers of Children's Sleepwear. "The losses will be shared. . . That means some of us may still go out of business, but at least we'll go out a little richer," he said.