In this paper, an optimal extended state observer (ESO) is designed for nonlinear integral chain system. For the first time, in this paper, proportional–integral (PI) extremum seeking control (ESC; PIESC) approach is applied to design a perturbation observer by minimizing the estimation error. The PI type structure of the ESC provides fast transient response for the closed-loop system to attain optimum equilibrium point. A mathematical proof is presented to show that the average error dynamic asymptotically converges to zero while the estimation error is minimized. The simulation results verify that the estimation error achieved by the proposed PIESC-based ESO (PIESC-ESO) is found significantly less than that achieved by the classic ESO and PSO-based ESO. Moreover, if slow changes occur within the system or external to it, the PIESC-ESO is still able to modify the observer gains such that the estimation error is minimized again. Therefore, this may help PIESC-ESO to be used in practical applications.