In this study, a novel inverse optimal controller based on NARMA-L2 modelling technique and online least squares support vector regression (LSSVR) method has been proposed for nonlinear nonaffine systems. Firstly, the nonlinear autoregressive with exogenous inputs (NARX) model of the system is obtained using online LSSVR method, then this model is decomposed into NARMA-L2 submodels. Hence, the non-affine system model is converted to a nonlinear affine system model. The obtained NARMA-L2 submodels are used in computing the inverse optimal control law. Furthermore, the parameters of the inverse optimal controller have also been optimized online using the Levenberg-Marquadt algorithm. The performance of the proposed LSSVR based inverse optimal controller using NARMA-L2 model has been evaluated by simulations carried out on two benchmark systems, and the results show that the LSSVR based NARMA-L2 model and inverse optimal controller attain good modelling and control performances.