China has committed to peak carbon emissions before 2030 and achieve carbon neutrality before 2060. As the province with the country's largest coal power installed capacity, with soaring electricity and heating demands, Shandong has unique pathways to gradually phase out coal power. However, thus far, no studies have investigated coal power phaseout pathways at the provincial or national level with thorough consideration of energy security, encompassing both power and heating supply security. Here, we established five-dimensional criteria based on unit efficiency and environmental and technical attributes to evaluate unit-level coal power retirement priority and used an integrated resource strategic planning model to explore coal power phaseout pathways in Shandong. Overall, as many as 144 coal power units, which account for 6% of the total installed capacity, should have the highest retirement priority. Shandong could retire 100,000 MW of coal power by 2050 without compromising energy security through the ambitious development of low-carbon heating technologies. The evaluation criteria are applicable to various regions globally to assess coal power retirement priority. Shandong's case demonstrates the importance of low-carbon heating technology deployment in accelerating coal power phaseout to address climate change and facilitate energy transition.