Publisher agrees to pay ‘substantial damages’ to drop long-running legal claims