AbstractThis paper studies the distributed optimization problem on the framework of a class of arbitrary relative degree uncertain nonlinear multi‐agent systems with the presence of exogenous disturbances. Based on the internal model principle and the pseudo gradient approach, a novel continuous‐time distributed optimization control protocol is proposed to make all the agents reach optimal consensus by utilizing local cost functions information and neighbors' states information. The main advantage of our algorithm is that it can run on systems with more complex dynamics, while the existing algorithms apply only to integral‐type systems or unity relative degree nonlinear systems. Moreover, the convergence of the algorithm is proved by Lyapunov function and graph theory analysis. Finally, the distributed protocol is physically implemented by circuits and tested on a group of Chua's circuit systems to show the effectiveness of the theoretical results.