(Reuters) - IBM Corp said on Sunday it had agreed to acquire U.S. software company Red Hat Inc for $34 billion, including debt, as it seeks to diversify its technology hardware and consulting business into higher-margin products and services.

The transaction is by far IBM’s biggest acquisition. It underscores IBM Chief Executive Ginni Rometty’s efforts to expand the company’s subscription-based software offerings, as it faces slowing software sales and waning demand for mainframe servers.

IBM, which has a market capitalization of $114 billion, will pay $190 per share in cash for Red Hat, a 63 percent premium to Friday’s closing share price.

Founded in 1993, Red Hat specializes in Linux operating systems, the most popular type of open-source software, which was developed as an alternative to proprietary software made by Microsoft Corp.

Headquartered in Raleigh, North Carolina, Red Hat charges fees to its corporate customers for custom features, maintenance and technical support, offering IBM a lucrative source of subscription revenue.

Red Hat is one of the very few companies in the cloud computing sector that has both revenue growth and free cash flow, Rometty, who has been IBM’s CEO since 2012, said in an interview with Reuters.

“This acquisition we are clearly doing for growth synergies. This is not about cost synergies at all,” Rometty said in the interview.

FILE PHOTO: A logo of IBM is seen at the Mobile World Congress in Barcelona, Spain February 28, 2018. REUTERS/Yves Herman/File Photo

The acquisition illustrates how older technology companies are turning to dealmaking to gain scale and fend off competition, especially in cloud computing, where customers using enterprise software are seeking to save money by consolidating their vendor relationships.

IBM is hoping the deal will help it catch up with Amazon.com Inc, Alphabet Inc and Microsoft in the rapidly growing cloud business. IBM shares have lost almost a third of their value in the past five years, while Red Hat shares are up 170 percent over the same period.

“This deal represents the culmination of IBM’s existing partnership with Red Hat, and, in our view, allows IBM to gain a highly strategic asset to advance its hybrid cloud initiatives,” Barclays analysts wrote in a research note.

They added that for the deal to work, it was important for IBM to uphold Red Hat’s neutrality when it came to operating platforms and maintain Red Hat’s open-source and multi-cloud position in the market.

BIG BLUE

IBM was founded in 1911 and is known in the technology industry as Big Blue, a reference to its once ubiquitous blue computers. It has faced years of revenue declines, as it transitions its legacy computer maker business into new technology products and services. Its recent initiatives have included artificial intelligence and business lines around Watson, named after the supercomputer it developed.

To be sure, IBM is no stranger to acquisitions. It acquired cloud infrastructure provider Softlayer in 2013 for $2 billion, and the Weather Channel’s data assets for more than $2 billion in 2015. It also acquired Canadian business software maker Cognos in 2008 for $5 billion.

Other big technology companies have also recently sought to reinvent themselves through acquisitions. Microsoft this year acquired open source software platform GitHub for $7.5 billion; chip maker Broadcom Inc agreed to acquire software maker CA Inc for nearly $19 billion; and Adobe Inc agreed to acquire marketing software maker Marketo for $5 billion.

One of IBM’s main competitors, Dell Technologies Inc, made a big bet on software and cloud computing two years ago, when it acquired data storage company EMC for $67 billion. As part of that deal, Dell inherited an 82 percent stake in virtualization software company VMware Inc.

The deal between IBM and Red Hat is expected to close in the second half of 2019. IBM said it planned to suspend its share repurchase program in 2020 and 2021 to help pay for the deal.

IBM said Red Hat would continue to be led by Red Hat CEO Jim Whitehurst and Red Hat’s current management team. It intends to maintain Red Hat’s headquarters, facilities, brands and practices.

Lazard Ltd offered financial advice to IBM, alongside Goldman Sachs Group Inc and JPMorgan Chase & Co, which also provided financing for the deal. Paul, Weiss, Rifkind, Wharton & Garrison LLP provided legal advice to IBM.

Guggenheim Partners LLC and Morgan Stanley were financial advisers to Red Hat, while Skadden, Arps, Slate, Meagher & Flom LLP offered legal advice to the company on the deal.

“Knowing first-hand how important open, hybrid cloud technologies are to helping businesses unlock value, we see the power of bringing these two companies together, and are honored to advise IBM and commit financing for this transaction,” JPMorgan CEO Jamie Dimon said in a statement.