Oracle Corporation is to buy Sun Microsystems in a deal worth $9.50 a share, valuing Sun at over $7 billion.
The deal comes a fortnight after talks between IBM and Sun collapsed, following IBM's decision to significantly lower its offer.
It will give Oracle access to Sun's strategically important Java and Solaris technologies, which underpin the Oracle database.
"Oracle will be the only company that can engineer an integrated system - applications to disk - where all the pieces fit and work together so customers do not have to do it themselves. Our customers benefit, as their systems integration costs go down while system performance, reliability and security go up," said Oracle CEO Larry Ellison.
Oracle said in a statement that Java is the most important technology it has acquired to date. The technology underpins Oracle Fusion Middleware, Oracle's fastest growing business.
Oracle's acquisition of Sun's Solaris operating system will allow it to optimise the Oracle database to take advantage of Solaris high-end features, the company said.
Sun said the combination of Oracle and Sun's technology would spur innovation across the technology market place.
"Oracle and Sun have been industry pioneers and close partners for more than 20 years," said Sun Chairman Scott McNealy. "This combination is a natural evolution of our relationship and will be an industry-defining event."
Jonathan Schwartz, Sun's CEO said: "From the Java platform touching nearly every business system on earth, powering billions of consumers on mobile handsets and consumer electronics, to the convergence of storage, networking and computing driven by the Solaris operating system and Sun's SPARC and x64 systems. Together with Oracle, we'll drive the innovation pipeline to create compelling value to our customer base and the marketplace."