In this work, the problem of online secure state estimation and attack reconstruction in the face of offensives that corrupt the sensor measurements and modify the actuator commands of cyber–physical systems is investigated for designing a resilient controller for the system. The states of cyber–physical system and its actuator attacks are estimated/reconstructed online using a novel adaptive line‐by‐line super‐twisting observer, whereas sparse stealth attacks on unprotected sensors are reconstructed using a sparse recovery algorithm. The estimated attacks are used for attack compensation by a resilient controller. The efficacy of the proposed technique is illustrated via simulation on a real electric power system under deception actuator attack and stealth sensor attack.