Apollo Global, a private-equity firm, has agreed to buy Rackspace in a $4.3 billion deal that would take the cloud-computing company private.

Rackspace will be acquired for $32 per share in cash, it said in a statement on Friday. That's a 38% premium to Rackspace's closing price on August 3, and 6% above the stock's closing price on Thursday. On August 3, reports surfaced that Rackspace was in talks to sell itself.

Rackspace's board unanimously approved the transaction, which is subject to approval from antitrust regulators in the US, the European Union, and Israel. The deal is expected to close in the fourth quarter of this year.

"We have great respect for the company's talented employees and their commitment to deliver expertise and exceptional service for the world's leading cloud platforms, said David Sambur, Partner at Apollo, in the statement.

Citigroup, Deutsche Bank, Barclays and Royal Bank of Canada are providing financing for the deal.

Rackspace shares gained as much as 4% to $31.55 in pre-market trading.