We examine analytical and numerical aspects of optimal control problems for firstorder elliptic systems in three dimensions. The particular setting we use is that of divcurl systems. After formulating some optimization problems, we prove the existence and uniqueness of the optimal solution. We then demonstrate the existence of Lagrange multipliers and derive an optimality system of partial differential equations from which optimal controls and states may be deduced. We then define least-squares finite element approximations of the solution of the optimality system and derive optimal estimates for the error in these approximations. 0 1999 Elsevier Science Inc. All rights reserved.