Nature-inspired algorithms are among the most powerful algorithms for optimization. In this paper, a load frequency control (LFC) in two-area power systems using the levy-flight firefly optimization algorithm (LFOA) is presented. The system simulation is realized by using MatLab/Simulink. The proposed LFOA-based PID controller has been compared with the firefly optimization algorithm (FOA)-based and particle swarm optimization (PSO) algorithm-based PID controllers. Simulations and results indicate that the proposed LFOA is superior to other ones for the LFC in two-area power systems.