This paper presents an electrical impedance tomography (EIT) method using a partial-differential-equationconstrained optimization approach. The forward problem in the inversion framework is described by a complete electrode model (CEM), which seeks the electric potential within the domain and at surface electrodes considering the contact impedance between them. The finite element solution of the electric potential has been validated using a commercial code. The inverse medium problem for reconstructing the unknown electrical conductivity profile is formulated as an optimization problem constrained by the CEM. The method seeks the optimal solution of the domain's electrical conductivity to minimize a Lagrangian functional consisting of a least-squares objective functional and a regularization term. Enforcing the stationarity of the Lagrangian leads to state, adjoint, and control problems, which constitute the Karush-Kuhn-Tucker (KKT) first-order optimality conditions. Subsequently, the electrical conductivity profile of the domain is iteratively updated by solving the KKT conditions in the reduced space of the control variable. Numerical results show that the relative error of the measured and calculated electric potentials after the inversion is less than 1%, demonstrating the successful reconstruction of heterogeneous electrical conductivity profiles using the proposed EIT method. This method thus represents an application framework for nondestructive evaluation of structures and geotechnical site characterization.