Updated from 2:07 p.m. EST

Following a lengthy trading halt, shares of

Research In Motion


fell Tuesday afternoon after a largely unfavorable ruling in a patent suit.

RIM shares dropped $4.65, or 5.2%, to $85.44. The decline in the stock followed a two-and-a-half-hour trading halt. Ahead of the news, the stock was up 4%.

The Court of Appeals for the Federal Circuit overturned a lower court's $54 million judgment against RIM, and overturned an order that could have prevented RIM from selling its popular BlackBerry messenger in the U.S.

That injunction was issued in August 2003 by a federal court in Virginia, where a jury had previously found RIM guilty of infringing patents owned by a privately held intellectual property company called


. The same court stayed the injunction pending RIM's appeal.

But it wasn't all good news for RIM. Tuesday's decision was based on how the lower court defined one of the terms at issue in the patent suit. The appeals court upheld the lower court's construction of other terms, and affirmed the district court's ruling that on 11 of 16 claims, RIM had infringed NTP's patents.

"We remand to the district court the questions of whether and to what extent the jury verdict of infringement should be set aside," the appeals court said in its ruling. "Because the jury verdict did not specify the amount of infringing sales attributed to each individual patent claim ... the district court on remand will also have to determine the effect of any alteration of the jury verdict on the district court's damage award and on the scope of the district court's injunction."

RIM representatives declined to comment on the ruling. Attorneys for both RIM and NTP also did not return calls seeking comment on the ruling.

A Virginia-based holding company that owns patents on wireless technology, NTP sued RIM in federal court more than two years ago. Last year, the company won its verdict and injunction against RIM.

Despite appealing the verdict, RIM has recognized costs related to the judgment and the case in every quarter since.

RIM has seen its revenues and earnings mushroom in recent quarters. But the NTP patent suit has threatened to disrupt the company's growth by forcing it to pay a hefty royalty fee to NTP or even potentially forcing it to exit the U.S. market, which is what NTP's patent covers.

Not everyone was downbeat on the ruling. The biggest positive for RIM is that while the appeals court handed down a decision, it's not the completely negative decision that many investors feared, said Rob Sanderson, who covers the company for American Technology Research.

With the case going back to the district court, there's a chance that RIM will get a better outcome this time around, he said. Not only could it be found not guilty of infringing the claims that were overturned on appeal, but the court could reduce the judgment against it, he said.

Additionally, RIM has asked the U.S. Patent & Trademark Office to reconsider NTP's patents, Sanderson noted. That could lead to the patents being thrown out altogether, he said.

"It's a draw, but both sides are going claim it's a win," Sanderson said. "But it's like I thought all along: It's not going to be over anytime soon."

(American Technology Research does not have an investment banking arm and Sanderson does not have a position in RIM.)