Business software maker Oracle Corp. (ORCL) beat out German rival SAP AG in its bid to buy Retek Inc. (RETK), reaching an agreement to purchase the retail software maker for about $670 million, Oracle said Tuesday.

Redwood Shores-based Oracle said in a news release that its offer of $11.25 per share was accepted and that SAP dropped out of the bidding. Retek shares, which had risen above the agreed price amid the bidding contest, fell 2 percent in the wake of the announcement.

"Oracle has the largest applications business in North America and we intend to expand that leadership position," Oracle CEO Larry Ellison (search) said in a statement. "Combining Oracle with Retek is an important step in that direction, and it strengthens our position in the retail applications market globally."

In Germany, SAP characterized itself as "a disciplined investor" that chose not to increase its bid.

"We concluded that neither our shareholders nor retail customers would benefit from an auction process that would further inflate the purchase price, and in the long run, not deliver the returns we demand," SAP chief executive Henning Kagermann said in a statement.

SAP thought it had reached a deal to buy Minneapolis-based Retek for $8.50 per share late last month before Oracle topped the offer, starting a bidding war.

"We believe that Oracle's offer is a good deal for Retek stockholders, and all directors in attendance at our board meeting have recommended that it be accepted," said Marty Leestma, President and Chief Executive Officer of Retek. "We will work with Oracle over the next several weeks to ensure that the integration is not disruptive for our clients and employees."

Kagermann said SAP would use the deal's termination fee of $25 million to develop its own retail software platform.

"I think it is fair for our customers as well as our shareholders to invest that money in further developing our own software platform," Kagermann said during a conference call.

Kagermann also sought to dismiss suggestions that the Retek battle was a prelude to a larger-scale fight with Oracle.

"I don't think there is a battle," he said.

The gamesmanship pitted the world's two leading makers of business applications software — the computer coding that automates a wide range of administrative tasks. SAP has long been the industry leader, but Oracle closed the gap two months ago by buying PeopleSoft Inc. (search) for $10.3 billion after a heated battle that dragged on for 18 months.

With just $174 million in annual revenue and 525 employees, Retek is a niche player in the industry. Nevertheless, the company holds tremendous appeal for both SAP and Oracle because its 200 customers are retailers — a group that hasn't bought as much business applications software as many other industries.

"Most Retek customers already run Oracle's financial and human resources applications, so Oracle buying Retek is a perfect fit for the retail industry," said Retek customer and Best Buy CIO, Bob Willet.

Retek's shares fell 27 cents, or 2.4 percrent, to $11.19 on the Nasdaq Stock Market. Oracle shares fell 7 cents to $12.58 on the Nasdaq.

SAP shares were trading steady at 120.03 euros ($158.10) on the Frankfurt exchange.