Repetitive and iterative learning control are two modern control strategies for tracking systems in which the signals are periodic in nature. This paper discusses repetitive and iterative learning control from an internal model principle point of view. This allows the formulation of existence conditions for multivariable implementations of repetitive and learning control. It is shown that repetitive control can be realized by an implementation of a robust servomechanism controller that uses the appropriate internal model for periodic disturbances. The design of such controllers is discussed. Next it is shown that iterative learning control can be implemented in the format of a disturbance observer/compensator. It is shown that the resulting control stucture is dual to the repetitive controller, and that both constitute an implementation of the internal model principle. Consequently, the analysis and design of repetitive and iterative learning control can be generalized to the powerful analysis and design procedure of the internal model framework, allowing to trade-off the convergence speed for periodic-disturbance cancellation versus other control objectives, such as stochastic disturbance suppression.