Abstract Radiofrequency (RF) ablation is a minimally invasive therapy for heart arrhythmia, including atrial fibrillation (A-fib), which creates lesions using an electric current to isolate the heart from abnormal electrical signals. However, conventional RF procedures do not involve intraoperative monitoring of the area and extent of ablation-induced necrosis, making the assessment of the procedure completeness challenging. Previous studies have suggested that spectroscopic photoacoustic (sPA) imaging is capable of differentiating ablated tissue from its non-ablated counterpart based on PA spectrum variation. Here, we aim to demonstrate the applicability of sPA imaging in an in vivo environment, where the cardiac motion presents, and introduce a framework for mapping the necrotic lesion using cardiac-gated sPA imaging. We computed the degree of necrosis, or necrotic extent (NE), by dividing the quantified ablated tissue contrast by the total contrast from both ablated and non-ablated tissues, visualizing it as continuous colormap to highlight the necrotic area and extent. To compensate for tissue motion during the cardiac cycle, we applied the cardiac-gating on sPA data, based on the image similarity. The in vivo validation of the concept was conducted in a swine model. As a result, the ablation-induced necrotic lesion at the surface of the beating heart was successfully depicted throughout the cardiac cycle through cardiac-gated sPA (CG-sPA) imaging. The results suggest that the introduced CG-sPA imaging system has great potential to be incorporated into clinical workflow to guide ablation procedures intraoperatively.