In this paper, we propose a two-mode adaptive fuzzy controller with approximation error estimator. In the learning mode, the controller employs some modified adaptive laws to tune the fuzzy system parameters and an approximation error estimator to compensate for the inherent approximation error. In the operating mode, the fuzzy system parameters are fixed, only the estimator is updated online. Mathematically, we show that the closed-loop system is stable in the sense that all the variables are bounded in both modes. We also establish mathematical bounds on the tracking error, state vector, control signal and the RMS error. Using these bounds, we show that controller's design parameters can be chosen to achieve desired control performance. After that, an algorithm to automatically switch the controller between two modes is presented. Finally, simulation studies of an inverted pendulum system and a Chua's chaotic circuit demonstrate the usefulness of the proposed controller.