SAP AG must pay Oracle Corp $1.3 billion in damages for software theft, a federal jury decided on Tuesday after a high-profile trial that captivated Silicon Valley.

The verdict drew a gasp from a packed courtroom and prompted hugs and handshakes among Oracle's legal team.

The award dwarfed SAP's estimate of the compensation owed Oracle, but fell short of the U.S. company's demands. Oracle sought at least $1.65 billion in damages, while Germany's SAP pegged its exposure at a maximum of $40 million.

SAP declined immediate comment.

Europe's top software maker had previously accepted liability for its TomorrowNow subsidiary having wrongfully downloaded millions of Oracle's files.

The two companies, which dominate the global market for software that helps businesses run more efficiently, this month began slugging it out in U.S. district court in Oakland, California, to determine the amount of damages.

The three-week trial featured testimony from such top executives as Oracle Chief Executive Larry Ellison and President Safra Catz. SAP co-CEO Bill McDermott also took the stand and apologized to Oracle for the events surrounding TomorrowNow.