A top appeals court has thrown out a jury ruling that ordered Apple to pay $368 million to VirnetX, a patent-holding company that many consider a “patent troll” because it exists exclusively to enforce patents. On Tuesday, the United States Federal Circuit Court of Appeals remanded the decision back to the lower federal court in East Texas.

The four patents ( 1 3 , and 4 ), which relate to FaceTime and VPN On Demand functions in Apple's iPhones, iPads, and Macs, were developed by a company called Science Applications International Corporation. Apple reportedly spent tens of millions of dollars to design FaceTime around the VirnetX patents, but it ultimately found itself embroiled in litigation anyway. The company also tweaked its VPN On Demand product to avoid infringement in 2013 after the lawsuit was well underway.

In its ruling (PDF), the appeals court did not rule that any of VirnetX's patents were invalid, and it only reversed the finding of infringement on one claim pertaining to a VPN On Demand patent. The court also said that the Texas District Court had not correctly defined a term that appeared in two of the patents, and it sent the decision back to Tyler, Texas so the court there can reassess the patent claims based on the appeals court's new term construction.

In throwing out the award that Apple was ordered to pay, the judges cited the testimony of VirnetX's damages expert, Roy Weinstein, who the court said improperly calculated what Apple gained from infringing on VirnetX's patents, and “therefore included various features indisputably not claimed by VirnetX, e.g., touchscreen, camera, processor, speaker, and microphone, to name but a few.”

The ruling added, “Apple argues that the testimony of VirnetX’s expert on the proper royalty base should have been excluded because it relied on the entire market value of Apple’s products without demonstrating that the patented features drove the demand for those products.” The appeals court agreed with Apple's argument.

The court also took issue with the way jury instructions on how to calculate damages were handled.

Apple is also tangled in a battle with VirnetX over the possibility of an ongoing royalty of 0.98 percent on all iPhones and iPads sold in the US that a district judge ordered back in March.

As of this writing, VirnetX's stock has tumbled over 44 percent. The company e-mailed Ars an optimistic press release, however, quoting VirnetX CEO and President Kendall Larsen as saying, “While we are disappointed that the Federal Circuit has vacated portions of the judgment for further proceedings, we are bolstered by the fact that the patents were again found valid and that it was confirmed that Apple’s VPN on Demand functionality infringes the VirnetX patents.”

“We look forward to readdressing the FaceTime infringement and damages issues as soon as possible,” Larsen wrote.

VirnetX reached a $200 million settlement with Microsoft in 2010, but it filed another lawsuit against Redmond last year. Also last year, a jury ruled that Cisco did not infringe on VirnetX's VPN patents.