This paper introduces a novel real-time ANFIS controller, specifically designed for thermal synchronous generators, to mitigate the risks associated with cyber-physical attacks on power systems. The controller integrates the dynamic model of the turbine’s thermomechanical components, such as the boiler and heat transfer processes, within the synchronous generator. In contrast to previous studies, this model is designed for practical implementation and addresses often-overlooked areas, including the interaction between electrical and thermomechanical components, real-time control responses to cyber-physical attacks, and the incorporation of economic considerations alongside technical performance. This study takes a comprehensive approach to filling these gaps. Under normal conditions, the proposed controller significantly improves the management of industrial turbines and governors, optimizing existing control systems with a particular focus on minimizing generation costs. However, its primary innovation is its ability to respond dynamically to local and inter-area power oscillations triggered by cyber-physical attacks. In such events, the controller efficiently manages the turbines and governors of synchronous generators, ensuring the stability and reliability of power systems. This approach introduces a cutting-edge thermo-electrical control strategy that integrates both electrical and thermomechanical dynamics of thermal synchronous generators. The novelty lies in its real-time control capability to counteract the effects of cyber-physical attacks, as well as its simultaneous consideration of economic optimization and technical performance for power system stability. Unlike traditional methods, this work offers an adaptive control system using ANFIS (Adaptive NeuroFuzzy Inference System), ensuring robust performance under dynamic conditions, including interarea oscillations and voltage deviations. To validate its effectiveness, the controller undergoes extensive simulation testing in MATLAB/Simulink, with performance comparisons against previous state-of-the-art methods. Benchmarking is also conducted using IEEE standard test systems, including the IEEE 9-bus and IEEE 39-bus networks, to highlight its superiority in protecting power systems.