Optimization problems where the constraint is a partial differential equation are important in many areas of the sciences and engineering. One such formulation is the Dirichlet distributed control problem, which can be written as a saddle point system. Here we present an ‘all-at-once’ method based on preconditioned MINRES, together with an efficient, optimal preconditioner which uses multigrid methods, to solve such problems.