Xerox Corp. said it will back out of its merger deal with Fujifilm Holdings Corp. as it reached a new settlement with two of its biggest shareholders, the latest twist in a monthslong tug of war over the future of the iconic American company.

The printer and copier company said it reached a settlement to replace its chief executive and overhaul its board after it ended a plan to combine with its joint venture with Fujifilm. This is Xerox’s second settlement with activist shareholders Carl Icahn and Darwin Deason; the company...