The firefly algorithm (FA) is a swarm intelligence algorithm capable of solving global optimization problems exactly; it has been used to solve many practical problems. However, traditional firefly algorithms solve complex optimization problems with a simple update method, which leads to premature stagnation due to the limitation of firefly diversity. To overcome these drawbacks, a novel hybrid firefly algorithm (HFA-DLL) with a double-level learning strategy is proposed. In HFA-DLL, a double-level learning strategy is proposed to avoid premature convergence and enhance the algorithm’s global search capability. At the same time, a competitive elimination mechanism is introduced to increase the accuracy of solving complex optimization problems and improve the convergence rate of the algorithm. Moreover, a stochastic disturbance strategy is designed to help the best solution jump out of the local optimum and minimize the time cost in the wrong direction. To understand the advantages and disadvantages of HFA-DLL, experiments were conducted on the CEC 2017 benchmark suite. Experimental results show that HFA-DLL outperforms other state-of-art algorithms in terms of convergence rate and exploration efficiency.