KKR & Co. and Clayton Dubilier & Rice LLC struck a deal to take Cloudera Inc. private in an all-cash deal valuing the company at about $5.3 billion, opening a new chapter for a once high-flying enterprise software firm that struggled to sustain growth against larger rivals.

The private equity giants agreed to buy out the software firm at $16 a share, or a 24% premium to its previous close, Cloudera said in a statement on Tuesday. Entities related to Carl Icahn’s Icahn Group, which holds about 18% of the outstanding shares, have agreed to vote in favor of the deal, the company said.

Cloudera — which counts the activist investor as its largest shareholder — has explored a potential sale since mid-2020 after receiving takeover interest, Bloomberg News has reported. The startup has seen revenue growth plunge to single digits over the past year from more than 80% two years ago, hurt in part by competition from larger rivals Amazon.com Inc., Alphabet Inc. and Microsoft Corp. in its field of cloud software products.

Cloudera shares surged 26% in premarket trading in New York from their previous close of $12.86. The stock had declined 7.5% this year.

The deal includes a “go shop” provision, expiring on July 1, that will let the board look for alternative bidders. If the deal is called off, Cloudera has agreed to pay a termination fee of between $92.5 million and $171.7 million depending on the reason for canceling the deal, according to the terms. The bidders have agreed to a termination fee of $290.6 million.

Cloudera was founded in 2008 and is backed by investors including Intel Corp., the second-largest shareholder according to Bloomberg data. When it went public in 2017, it was valued at about half of its $4.1 billion valuation as a private company.

It closed an all-stock merger with rival Hortonworks in 2019 and had struggled to integrate it, eventually attracting the attention of Icahn, who criticized Cloudera’s strategy. The activist investor eventually reached an agreement that awarded his firm two seats on the company’s board.

Morgan Stanley was Cloudera’s financial adviser. GCA Advisors, Bank of America Corp., William Blair & Co., Perella Weinberg Partners LP, Cowen Inc. and JPMorgan Chase & Co. were financial advisers to CD&R and KKR. JPMorgan, Bank of America, and KKR Capital Markets will provide debt financing for the deal.