The US business software company Oracle Corporation today pounced on a troubled Silicon Valley rival, Sun Microsystems, in a $7.4bn (£5.1bn) agreed takeover hastily struck after an alternative buyout by the computer manufacturer IBM fell apart.

In a tie-up that came as a surprise to both Wall Street and the technology community, Oracle announced it was paying $9.50 a share for Sun, valuing the company at $5.6bn once its outstanding cash and debt are factored out.

The takeover came amid the most frenetic flurry of Wall Street deal-making activity for months as the soft drinks maker Pepsi made a $6bn offer for two of its bottlers and GlaxoSmithKline bought a US skincare specialist, Stiefel Laboratories, for $3.6bn. But hopes that the multibillion-dollar transactions indicated a softening in the financial markets were dashed as shares plunged on both sides of the Atlantic.

By the close of trading in London, the FTSE 100 index had fallen by 101 points to 3,990. During the morning session in New York, the Dow Jones industrial average slipped by more than 200 points on renewed concern about rotten debts clogging up the banking system.

Oracle's move on Sun is partly motivated by a desire to snap up two pieces of software – the programming language Java and Sun's Solaris operating system, both widely used throughout the world. The transaction ends 27 years of independence for Sun, which was founded by four graduate students in California and was originally named to stand for Stanford University Network.

Sun had previously been in talks to sell itself to IBM, which was initially willing to pay a higher price of between $10 and $11 a share. But talks broke down two weeks ago as IBM reduced its valuation, and amid potential delays in getting clearance from the competition authorities.

Sun's chairman, Scott McNealy, said the combination with Oracle marked a "momentous day" in the technology world: "There is no question in my mind that this transaction redefines the industry."

McNealy said that Sun and Oracle, having been "pioneers and partners for way longer than I like to think about"‚ were "coming together for the next phase of computing". Sun's stock rocketed by 36% to $9.16 during early trading on the technology-dominated Nasdaq exchange.

A pioneer in network computing, Sun was valued at more than $200bn during the dotcom boom of the late 1990s. But orders for its servers and storage computers have been slowing and it has made losses in three of the past four quarters.

Oracle sees the company as a logical fit because Sun's Java and Solaris software is already used in its own fleet of databases and in its middleware software, which joins diffuse applications. Oracle's chief executive, Larry Ellison, said Java was one of the industry's best-known brands, used on hundreds of millions of computers, mobile phones and even DVD players.

Ellison said the combined company would deliver complete systems "from database to desk" to its 320,000 global customers: "With the acquisition of Sun, Oracle will be able to make all the pieces of the technology stack fit together."

Analysts have suggested for some time that Sun's prospects were fading and that it needed a buyer. Before the negotiations with IBM, there had been speculation that hardware manufacturers Hewlett-Packard or Dell could be interested.

Ray Wang, an industry expert at Forrester Research in California, said that although Java and Solaris appeared the "crown jewels" of the deal, there were other benefits: "Oracle also gains an innovation engine with the assets of Sun's Labs group, which pioneers a series of innovations that include potential enterprise solutions for the virtual world."

With a global workforce of 30,000, Sun employs 2,000 people in Britain and Ireland. The company has a regional head office in Camberley, Surrey, and a manufacturing arm in Linlithgow, West Lothian. The company announced in December that it was shutting its plant in Scotland, with a loss of 130 jobs.