Studying how China's outward foreign direct investment (OFDI) affect total-factor carbon emission performance (TFCEP) of the Belt and Road Initiative (BRI) countries is essential. It helps evaluate the effectiveness of China's BRI and improves China's future investment decisions. This study evaluates the TFCEP of 65 BRI countries between 2005 and 2020, and explores how China's OFDI influences TFCEP in BRI countries by a spatial difference-in-differences model. The results reveal a notable improvement in TFCEP among BRI countries following BRI implementation, with technological advancement having a crucial influence on this enhancement. China's OFDI are shown to have raised income levels and optimised industrial structures in BRI countries but have not substantially increased renewable energy generation. The primary contributions of China's OFDI to TFCEP improvements in BRI countries are through industrial structure optimization and technology advancement effects. The impact of China's OFDI on TFCEP varies geographically, being most significant in Southeast Asian countries, followed by Central Asia, Western Asia, Europe, and Africa. However, its effect is minimal in countries like Syria, Tunisia, and Algeria. The study suggests that the Chinese government should devise investment strategies tailored to the unique needs of BRI countries, emphasizing green development.