Gabriel Bouys/AFP/Getty Images

IBM has agreed to acquire open-source software company Red Hat for $34 billion, the company announced Sunday.

It's all about competitive balance. IBM hopes the acquisition will help it expand its position in the enterprise cloud computing market to better compete with the likes of Amazon, Google and Microsoft. Red Hat, which specializes in the Linux operating system, charges customers for support, training and consulting services.

The acquisition -- IBM's largest ever -- highlights the company's efforts to increase subscription-based software offerings as demand for mainframe servers and software declines.

"The acquisition of Red Hat is a game-changer. It changes everything about the cloud market," IBM CEO Ginni Rometty said in a statement. "IBM will become the world's #1 hybrid cloud provider, offering companies the only open cloud solution that will unlock the full value of the cloud for their businesses."

Larry Dignan at CNET sister site ZDNet says the Red Hat acquisition "gives IBM software heft and an OpenStack playbook that can rival VMware, which incidentally has become quite cozy with [Amazon Web Services]."

The Raleigh, N.C.-based software company will operate as a distinct unit within IBM's Hybrid Cloud team.

IBM will pay $190 per share in cash for Red Hat, a 62 percent premium over Friday's closing share price. The deal is expected to close in the second half of 2019.

In early trading Monday, IBM's shares were down more than 2 percent to around $121.80. Red Hat shares, meanwhile, were soaring, up about 48 percent to around $172.50.

First published Oct. 28 at 1:11 p.m. PT.

Updated Oct. 29 at 6:18 a.m. PT: Added comment from ZDNet.

Updated at 7:40 a.m. PT: Added the stock price movement for IBM and Red Hat.

5G is your next big upgrade: Everything you need to know about the 5G revolution.

NASA turns 60: The space agency has taken humanity farther than anyone else, and it has plans to go further.