Mattel won a partial victory Thursday when a federal appeals court tossed out $172 million in damages the toy giant had been ordered to pay to the maker of Bratz dolls.

The 9th Circuit U.S. Court of Appeals vacated an April 2011 jury verdict that favored MGA Entertainment in a countersuit claiming that El Segundo-based Mattel Inc. stole trade secrets.

Thursday's appeals court decision was based on a technicality, that Van Nuys-based MGA's trade-secrets countersuit should not have been tried by the jury because it was not sufficiently relevant to Mattel's suit.

"Because MGA's trade-secret claim should not have reached this jury, we vacate the verdict along with the related damages, fees and costs," Chief Judge Alex Kozinski wrote in the court's opinion.

MGA based its countsuit on its claims that Mattel employees spied on its products at toy fairs.

Thursday's decision also partially favored MGA, which the court said is still entitled to $136 million in legal fees it spent fighting Mattel's lawsuit.

"The district court did not abuse its discretion in awarding MGA fees for fighting against Mattel's claim, which was `stunning in scope and unreasonable in the relief it requested,"' Kozinski wrote.

Mattel welcomed the ruling and suggested that the legal issues underpinning the case were largely over.

In a statement, Mattel said: "While MGA can in theory bring a new lawsuit based on its toy fair claims, we are confident that such a lawsuit will be barred by the statute of limitations. We look forward to the speedy and final resolution of this dispute, and will continue to focus our efforts on successfully competing in the marketplace."

MGA declared victory over the court's decision that Mattel was still liable for the $136 million in legal costs.

"We are gratified that the 9th Circuit affirmed the largest fee and cost award in a copyright infringement case in U.S. history and continued to hold Mattel liable for pursing its frivolous claims against us," MGA CEO Isaac Larian said in a statement.

Larian vowed to pursue a new jury trial against Mattel for allegedly stealing his company's trade secrets, expressing confidence that "when the second jury hears about Mattel's sneaking into our showrooms and egregious theft of scores of our secrets over the years, they will be even more appalled than the first jury and award MGA even greater damages."

Mattel first sued MGA in 2004, claiming that the world's biggest toymaker owned the rights to MGA's blockbuster Bratz dolls franchise, which had debuted in 2001. Mattel claimed that Bratz designer Carter Bryant was working at Mattel when he made the initial drawings for the edgy, pouty dolls with large eyes.

In 2008, a federal jury awarded Mattel $100 million in damages. An appeals court overturned that verdict. In a second trial in 2011, a jury found in favor of MGA on the copyright issue.

In Thursday's ruling, Kozinski concluded the court's opinion with advice: "While this may not be the last word on the subject, perhaps Mattel and MGA can take a lesson from their target demographic: Play nice."

muhammed.el-hasan@dailybreeze.com

Follow Muhammed El-Hasan on Twitter at http://twitter.com/dailybreezebiz

The Associated Press contributed to this article.