The iterative learning control (ILC) method improvesperformance of systems that repeat the same task several times. In this paper the standard norm-optimal ILC control law for linear systems is extended to an estimation-based ILC algorithm where the controlled variables are not directly available as measurements. The proposed ILC algorithm is proven to be stable and gives monotonic convergence of the error. The estimation-based part of the algorithm uses Bayesian estimation techniques such as the Kalman filter. The objective function in the optimisation problem is modified to incorporate not only the mean value of the estimated variable, but also information about the uncertainty of the estimate. It is further shown that for linear time-invariant systems the ILC design is independent of the estimation method. Finally, the concept is extended to non-linear state space models using linearisation techniques, where it is assumed that the full state vector is estimated and used in the ILC algorithm. It is also discussed how the Kullback-Leibler divergence can be used if linearisation cannot be performed. Finally, the proposed solution for non-linear systems is applied and verified in a simulation study with a simplified model of an industrial manipulator system.