Coastal cities, due to their proximity to coastlines and unique climatic conditions, face growing challenges from extreme temperature events associated with climate change. Research on the impact of extreme temperatures on tuberculosis (TB) in these cities is limited, and findings from different regions lack consensus. This study focuses on Shantou, a coastal city in China, to investigate the influence of extreme temperatures on TB within this distinctive geographical context. Distributed Lag Non-Linear Models (DLNM) were employed to evaluate the effect of extreme temperatures on TB incidence risk in Shantou, a coastal city in China, spanning from 2014 to 2021. Daily TB case data were provided by the Shantou Tuberculosis Prevention and Control Institute. Daily meteorological information was sourced from the Reliable Prognosis website, while daily air pollutant data were obtained from the China Air Quality Online Monitoring and Analysis Platform. The study revealed a significant association between extreme temperatures and TB incidence, with the impact peaking at a lag of 27 days after exposure. Notably, extreme cold temperatures led to a temporary decrease in TB incidence with a lag of 1-2 days. Subgroup analysis indicated that males had a notably higher risk of TB under extreme temperature conditions compared to females. Additionally, individuals aged 65 years and above showed a significant cumulative effect in such conditions. This research enhances our comprehension of the effects of extreme temperatures on TB in coastal cities and carries substantial public health implications for TB prevention in China.