The CEO of Xerox is quitting and the company's plan to be taken over by Japan's Fujifilm has been thrown into doubt.

Xerox (XRX) said in a statement late Tuesday that it's reached a deal with activist investors Carl Icahn and Darwin Deason, who have been trying to kill the Fujifilm (FUJIF) deal and push out CEO Jeff Jacobson.

Under the agreement, Jacobson and six other current Xerox board members, including Chairman Robert Keegan, are stepping down to allow representatives of Icahn and Deason to take control of running the iconic US printer and copier company.

The Xerox board said it decided to strike a deal with the activist investors after a US judge on Friday temporarily blocked the company's planned merger with Fujifilm. The ruling was the result of a lawsuit brought by Deason in February challenging the merger.

Related: Carl Icahn: Don't let Fujifilm 'steal' Xerox

The agreement between the two sides Tuesday will end the litigation and a battle over board seats that was set to take place at the next Xerox shareholders' meeting, the company statement said.

The new board plans to meet "immediately" to consider "terminating or restructuring Xerox's relationship with Fujifilm and the proposed transaction with Fujifilm," according to the statement.

But it's set to face a fight from the Japanese company, which said in a statement Wednesday that it has "serious concerns" about the settlement between Xerox and the activist investors.

Under the plan that Xerox and Fujifilm announced in January, the US company's operations would be merged with those of Fuji Xerox, a joint venture between the two firms. The multibillion-dollar deal would leave Fujifilm holding 50.1% of Fuji Xerox, with Xerox shareholders owning the rest.

Related: Fujifilm moves to take control of Xerox

Icahn and Deason argued that it "dramatically undervalues" Xerox and would be the "final death knell" for the US company. The two investors, who together hold around 15% of Xerox stock, accused the company's board of overseeing "the systematic destruction of Xerox."

Fujifilm said Wednesday it believes the Xerox board "has an obligation" to stick to the deal the companies agreed in January, adding that it will appeal Friday's court ruling that halted the merger.

Fujifilm shares dropped more than 5% in Tokyo on Wednesday.

Icahn welcomed the court ruling and Tuesday's agreement with the Xerox board, saying they "mark a watershed moment for corporate governance generally and for Xerox specifically."

Keith Cozza, the CEO of Icahn Enterprises (IEP), is set to become the new chairman of Xerox, according to the company statement. And John Visentin, an IT industry veteran who worked as a consultant to Icahn Enterprises during the battle over Xerox, is expected to be the new CEO.