A New York judge on Friday handed embattled J.C. Penney Co Inc an interim victory in its dispute with Macy's Inc over goods designed by Martha Stewart.

But the judge said his ruling, which clears J.C. Penney to sell such goods as long as they don't carry the Martha Stewart name, was only a "bye" in the wider war. And he had harsh words for former J.C. Penney Chief Executive Ron Johnson, who he called the "architect" of the dispute.

The two national retailers are battling over the rights to sell Martha Stewart products in what are challenging times for department stores, especially J.C. Penney. Friday's ruling capped a week in which J.C. Penney ousted Johnson as chief executive and hired advisers to help it position itself financially.

Macy's claims it has the exclusive right to sell Martha Stewart goods in categories such as bedding, bath, and tableware, under a 2006 agreement that runs to 2018.

Macy's sued J.C. Penney and Stewart's company, Martha Stewart Living Omnimedia Inc, when they announced a partnership in December 2011.

Last year, Justice Jeffrey Oing blocked J.C. Penney from selling the disputed goods under a Martha Stewart label.

His ruling on Friday denied a request by Macy's to expand that ban to include products that would be branded "JCP Everyday."

Ted Grossman, a lawyer for Macy's, said he would appeal the ruling to prevent it from taking effect.

J.C. Penney said it plans to make the products available for sale in May.

The judge's decision was a reprieve for J.C. Penney, which has already had the products manufactured and is storing them in warehouses. An analyst has estimated the value of the goods at $100 million.

"J.C. Penney has been a given a proverbial bye in this case," Oing said as ruled.

In making his decision, the judge said he could not ignore the economic harm that an adverse ruling would have caused J.C. Penney, "even if it is the result of their own acts."

J.C. Penney went ahead and manufactured the disputed products under the "JCP Everyday" label after the judge barred the Martha Stewart products last summer.

J.C. Penney's actions, Oing said, were spurred on by former CEO Johnson, whose conduct "may be less than admirable."

"The personal architect of this whole dispute has been fired by J.C. Penney's," the judge said during Friday's hearing.

Johnson, who negotiated the deal with Martha Stewart as a key component of his plan to re-invent J.C. Penney, was ousted as chief executive on Monday and replaced by his predecessor, Mike Ullman.

According to email evidence, Johnson wanted Stewart to break her agreement with Macy's. He thought he had found a way around that when Stewart told him her contract with Macy's allowed her to sell the disputed goods at her own stores.

J.C. Penney and Stewart planned to launch Martha Stewart stores within J.C. Penney before Macy's sued. Macy's claims the proposed boutiques don't fall into the exception.

On Thursday, sources said J.C. Penney had hired Blackstone Group LP's financial advisory arm to explore how to position the retailer financially. Under Johnson, sales dropped 25 percent last year.

The trial continues on Tuesday.

The cases are Macy's Inc v Martha Stewart Living Omnimedia Inc, 650197/2012, and Macy's Inc v J.C. Penney Corp, 652861/2012, New York State Supreme Court, New York County.

(Reporting by Karen Freifeld; Editing by Gunna Dickson and Eric Walsh)