This paper is concerned with design of distributed optimal synchronization control strategies for a class of networked nonlinear heterogeneous multi-agent (HMA) systems whose dynamics are governed by Euler–Lagrange (EL) equations. We employ optimal control techniques to design synchronization (consensus seeking) and set-point regulation controllers for HMA systems through optimization of individual cost functions. We introduce an analytical solution to the optimization problem and show that the developed optimal control laws can manage switchings in the communication network topology. Additionally, we propose two control strategies (namely, adaptive and robust) to modify and generalize the developed optimal control laws in presence of parametric uncertainties in the HMA systems. Simulation results for the attitude synchronization control of a network of eight spacecraft are presented to demonstrate the effectiveness and capabilities of our proposed control algorithms.