In this paper, an optimal parameter set tuning method for proportional-integral-derivative (PID) controller and fractional order PID controller is proposed using teaching-learning based optimization (TLBO) algorithm. During the optimization of the PID and FOPID controller parameters, an objective function consisting of overshoot, rise time, settling time and steady state error is formulated to achieve a satisfactory trade-off between the dynamic response characteristics. TLBO algorithm is used as the optimizer to find the best parameters of the proposed controllers. The designed PID and FOPID controllers are applied to an automatic voltage regulator (AVR) system. The performances of the proposed controllers are confirmed by comparing their results with those obtained from different optimized PID and FOPID controllers previously published in the literature for the same AVR system. The numerical simulations and comparisons show that the proposed controllers provide the better dynamic response characteristics as well as more robust to model uncertainties than the other different optimized controllers. The results obtained with the proposed controllers show a better trade-off between the set point tracking performance, robustness and stability.