Lexmark International Inc. (NYSE: LXK), a computer-printer maker, agreed to be acquired by an investment consortium led by Apex Technology Co. and PAG Asia Capital in a transaction that values the company at $3.6 billion.

The all-cash deal, worth $40.50 per Lexmark share, will be financed through equity contributions from the buyers and debt financing, the company said Tuesday in a statement. The transaction, approved by Lexmark’s board, is expected to close in the second half of 2016 and is subject to certain shareholder and regulatory approvals. Legend Capital Management Co. is also a member of the consortium.

“This is an exciting transaction that Lexmark’s board of directors believes is in the best interests of our shareholders,” Lexmark Chairman and Chief Executive Officer Paul Rooke said in the statement. “The transaction will benefit our customers and provide new opportunities for our employees.”

The agreement brings to a close months of speculation about what might become of Lexmark, which had fallen on hard times as a shift to digital documents resulted in lower demand for its printing products. Lexmark’s board in October said it hired Goldman Sachs Group Inc. to help explore strategic alternatives.

The purchase price represents a 17 percent premium on Lexmark’s closing share price of $34.66 on Tuesday. The shares have gained 12 percent since the close on Oct. 21, 2015, the date before Lexmark’s plans to consider strategic alternatives became public.

The company had attracted bids for its software division from private equity firms Thoma Bravo and Vista Equity Partners while Lexmark’s hardware division separately had generated interest from companies including Canon Inc. and Ricoh Co., people familiar with the situation said in February.

Lexmark reported $968.8 million in fourth-quarter sales, with about 83 percent coming from its Imaging Solutions and Services unit, which houses its printing division, according to data compiled by Bloomberg. The company’s software division reported $160.8 million in quarterly revenue.

Apex is based in Guangdong, China while PAG Asia Capital is a buyout arm of one of Asia’s largest private equity firms. Legend Capital is a venture arm of Legend Holdings based in Beijing.

Lexmark’s two business groups, as well as the company’s regional and country operations, will continue unaffected and its headquarters will remain in Lexington, Kentucky, according to the statement. Rooke is expected to continue to head Lexmark after the deal closes, the company said.

Goldman Sachs was financial adviser to Lexmark and Wachtell, Lipton, Rosen & Katz was the company’s legal counsel. Moelis & Co. acted as financial adviser to the consortium with Skadden, Arps, Slate, Meagher & Flom and King & Wood Mallesons as legal counsel.

In other recent technology deals, Apax Partners will acquire a majority stake in insurance software provider Duck Creek Technologies; Autodesk Inc. (Nasdaq: ADSK) has purchased 3D animation company Solid Angle; and Vista Equity Partners LLC agreed to buy event management software firm Cvent Inc. (NYSE: CVT).