Controlling the air-fuel ratio system (AFR) in lean combustion spark-ignition engines is crucial for mitigating emissions and addressing climate change. In this regard, this study proposes an enhanced version of the Aquila optimizer (ImpAO) with a modified elite opposition-based learning technique to optimize the feedforward (FF) mechanism and proportional-integral (PI) controller parameters for AFR control. Simulation results demonstrate ImpAO’s outstanding performance compared to state-of-the-art algorithms. It achieves a minimum cost function value of 0.6759, exhibiting robustness and stability with an average ± standard deviation range of 0.6823±0.0047. The Wilcoxon signed-rank test confirms highly significant differences (p<0.001) between ImpAO and other algorithms. ImpAO also outperforms competitors in terms of elapsed time, with an average of 43.6072 s per run. Transient response analysis reveals that ImpAO achieves a lower rise time of 1.1845 s, settling time of 3.0188 s, overshoot of 0.1679%, and peak time of 4.0371 s compared to alternative algorithms. The algorithm consistently achieves lower error-based cost function values, indicating more accurate control. ImpAO demonstrates superior capabilities in tracking the desired input signal compared to other algorithms. Comparative assessment with recent metaheuristic algorithms further confirms ImpAO’s superior performance in terms of transient response metrics and error-based cost functions. In summary, the simulation results provide strong evidence of the exceptional performance and effectiveness of the proposed ImpAO algorithm. It establishes ImpAO as a reliable and superior solution for optimizing the FF mechanism-supported PI controller for the AFR system, surpassing state-of-the-art algorithms and recent metaheuristic optimizers.