Carl Icahn has agreed to sell his remaining Xerox shares back to the printer and copy-machines maker for $542 million. The deal ends an investment by the veteran activist investor spanning nearly a decade.

Xerox is to pay $15.84 apiece to buy shares held by Icahn and his affiliates, a price that matches Wednesday’s closing, the company said in a September 28 press release. The transaction is expected to be funded by a new debt facility, Xerox added.

After the transfer is complete, Icahn lieutenants Jesse Lynn and Steven Miller are to step down from Xerox’s board, along with the company’s chairman, James Nelson. Scott Letier, a Xerox director since 2018, will take the chair role after Nelson’s departure, the company said.

Icahn first disclosed a 7.1% stake in Xerox back in November 2015. Only two months later, the company gave Icahn three board seats as it was preparing to split itself in two, a plan that later attracted the ire of another major shareholder, Darwin Deason.

Icahn reignited his campaign in late 2017, when he asked for four board slots and the replacement of the company’s CEO. Shortly after, Xerox revealed that it was in discussions with Japanese counterpart Fujifilm Holdings about a potential takeover. Icahn and Deason teamed up to push against the contemplated sale of Xerox to Fujifilm, which erupted in a legal fight that ended in a court order barring the transaction.

In May 2018, Xerox caved in and settled with the two activist inventors, giving them control over the business. Shortly after that, Xerox appointed John Visentin, an advisor to Icahn in his dispute with the company, as its chief executive. In 2020, Xerox engaged in a hostile pursuit for PC manufacturer HP, with Icahn reportedly pushing for a deal behind the curtains. After several rebuttals, Xerox eventually abandoned its bid for HP.

“As a longtime shareholder of Xerox, I’ve watched this iconic brand endure the hardest of times and come out stronger, all while returning substantial amounts of capital back to shareholders,’’ commented Icahn on Thursday. ‘‘I helped Xerox maintain its independence while pursuing consolidation within the print industry.’’

“For nearly a decade, Carl and his affiliates have served as important shareholders to Xerox, providing invaluable counsel, guidance and activism to support our evolution as a workplace technology leader,’’ said Xerox CEO Steve Bandrowczak.