Google is buying cybersecurity firm Mandiant for $5.4 billion, adding heft as rivals Microsoft and Amazon also look to beef up security for their fast-growing cloud units.

The deal will enhance Google's cloud computing business, which generates more than $19 billion  annually, and bolster its security operations and advisory services, the company said on Tuesday.

The Information reported the news first on Monday.

Microsoft was also said to be eyeing a buyout of Mandiant, according to news reports. The software giant had previously forecast spending $20 billion spend on cybersecurity over the next five years.

Google's offer of $23 per share represents a premium of about 53 percent to Mandiant's stock price levels before reports that Microsoft was eyeing a deal.

Shares of Mandiant fell 2 percent, while those of Alphabet rose 0.2 percent to $2532.20 in premarket trading on Tuesday.

Mandiant, which focuses on cyber-incident response and cybersecurity testing, became a standalone entity last year when FireEye, which acquired the company in 2013, sold its products business and the FireEye name for $1.2 billion to a consortium led by private equity firm Symphony Technology Group.

The firm has become a go-to for news organizations and companies for investigating cyberattacks, including recent breaches at News Corp and Nvidia.

The deal is expected to close later this year. © Reuters