Oracle Corp suffered a significant setback as a U.S. judge discarded its $1.3 billion jury verdict against SAP AG, paving the way for a possible new trial in the years-long dispute.

In a ruling released on Thursday, U.S. District Judge Phyllis Hamilton called the $1.3 billion copyright infringement verdict against SAP grossly excessive.

Oracle had proven actual damages of only $272 million, wrote Hamilton, who called for a new trial unless Oracle agreed to accept that amount.

Oracle shares fell 0.8 percent to close at $27.85 on Nasdaq.

The legal battle between two of the software industry's largest players captivated Silicon Valley last year. A three-week trial included testimony from such top executives as billionaire Oracle CEO Larry Ellison and Oracle President Safra Catz.

The jury awarded Oracle $1.3 billion over accusations that SAP subsidiary TomorrowNow wrongfully downloaded millions of Oracle files.

Oracle spokeswoman Deborah Hellinger on Thursday said there was voluminous evidence on the tremendous value of Oracle's stolen intellectual property.

We believe the jury got it right and we intend to pursue the full measure of damages that we believe are owed to Oracle, Hellinger said.

SAP spokesman Jim Dever said the company is very gratified by the decision as it believed the verdict was wrong.

We hope the court's action will help drive this matter to a final resolution, Dever said.

In analyzing its options, Oracle can either accept the $272 million figure, ask for a new trial, or appeal Hamilton's ruling, said Chris Scott Graham, a Northern California intellectual property lawyer who is not involved in the case.

There's going to be some interesting internal discussions at Oracle, Graham said, adding that SAP could also appeal the $272 million figure.

Hamilton found Oracle's $1.3 billion damages award contrary to the weight of the evidence.

Oracle elicited self-serving testimony from its executives regarding the price they claim they would have demanded in an admittedly fictional negotiation, Hamilton wrote.

The judge found that Oracle proffered the speculative opinion of its damages expert, which was based on little more than guesses about the parties' expectations.

During the trial, SAP's lawyers accused Ellison of plucking damages numbers out of the air.

Eric Goldman, a professor at Santa Clara University School of Law, said a $272 million damages award is still very rare in copyright litigation.

Oracle still got a huge dollar amount in a copyright case, it still knocked TomorrowNow out of the marketplace, and it still got all the glory of having shined a negative spotlight on SAP, Goldman said.

At trial in Hamilton's Oakland, California courtroom, SAP co-CEO Bill McDermott took the stand and apologized to Oracle for the events surrounding TomorrowNow.

Oracle also linked former SAP chief and current Hewlett-Packard CEO Leo Apotheker to the operations of TomorrowNow during the trial. But it did not appear to produce evidence to prove Apotheker knew of any theft.

The case in U.S. District Court, Northern District of California is Oracle USA, Inc., et al. v. SAP AG, et al, 07-1658.

(Additional reporting by Poornima Gupta, editing by John Wallace, Richard Chang and Bernard Orr)