Gilead Sciences will not have to pay a $200 million jury award for infringing two Merck & Co. patents on hepatitis C medication. The U.S. Court of Appeals for the Federal Circuit on Thursday backed a San Jose trial judge’s decision to throw out the award based on Merck’s unclean hands.

U.S. District Judge Beth Labson Freeman had found that a Merck patent prosecutor breached an ethical firewall in prosecuting the company’s patents, and then gave false testimony about his role at a deposition.

“Those findings establish serious misconduct, violating clear standards of probity in the circumstances, that led to the acquisition of the less risky ’499 patent,” Judge Richard Taranto wrote in Gilead Sciences v. Merck.

Taranto stressed throughout his opinion that the doctrine of unclean hands is not to be invoked lightly. But in this case, Merck’s conduct was “immediately and necessarily related to the equity of giving Merck the relief of patent enforcement it seeks in this litigation,” Taranto concluded.

Wednesay’s decision culminates a jury trial that led to a $200 million award, a bench trial unwinding it, and then a 95-minute long oral argument before the Federal Circuit in February. In the middle of it all has been Fish & Richardson partner Juanita Brooks, who tried the case and then led an all-women team for Gilead at the Federal Circuit hearing.

“It took awhile. It wasn’t necessarily a straight course, but we are very pleased with the outcome,” Brooks said Wednesday.

Jurors found that Gilead’s sofosbuvir compound, an active ingredient in such medications as Sovaldi and Harvoni, infringed Merck’s 7,105,499 and 8,481,712 patents. Gilead had obtained sofosbuvir with its 2011 acquisition of Pharmasset Inc. for $11 billion. By the time of trial, Sovaldi and Harvoni had rung up $20 billion in sales.