In this paper, a new method, based on firefly algorithm (FA) and extreme learning machine (ELM), is proposed to control chaos in nonlinear system. ELM is an efficient predicted and classified tool, and can match and fit nonlinear systems efficiently. Hence, mathematical model of uncertain nonlinear system is obtained indirectly. For higher fitting accuracy, a novel swarm intelligence algorithm FA is drawn in our proposed way. The main advantage is that our proposed method can remove the limitation that mathematical model must be known clearly and can be applied to unknown nonlinear chaotic system.