The basic idea of image registration is to find a reasonable transformation of an image so that the resulting difference between it and another image is made small. We derive an optimal control method for determining such a transformation; the approach is based on the grid deformation method and seeks to minimize an objective functional that measures the difference between the transformed image and the reference image. The existence of an optimal transformation is proved as is the applicability of the Lagrange multiplier method. Then, an optimality system from which optimal transformations can be obtained is derived. Keywords Image registration · Optimal control problem · Grid deformation method · Optimal solution · Lagrange multipliers