Ninth-grade English as a Foreign Language (EFL) learners encounter significant difficulties in developing ideas into coherent paragraphs, maintaining grammatical accuracy, particularly consistent sentence structure, and selecting contextually appropriate vocabulary. These challenges are often accompanied by low writing confidence and limited active participation, especially in collaborative learning settings, which hinder the development of effective written communication. Despite the growing integration of technology in language learning, empirical evidence regarding the effectiveness of AI-assisted tools in overcoming these challenges remains limited, particularly at the secondary level in Indonesian contexts. This study aimed to investigate the effect of AI-supported collaborative writing through ChatGPT on students’ engagement and writing performance. This study employed a mixed-methods approach with a quasi-experimental design involving 72 ninth-grade students from SMPIT Az-Zahra Demak, divided into an experimental group (n = 36) that used ChatGPT and a control group (n = 36) that used conventional instruction. Data were collected through writing tests, engagement questionnaires measuring behavioral, emotional, and cognitive dimensions, and semi-structured interviews. Quantitative data were analyzed using ANCOVA, while qualitative findings were analyzed through thematic analysis using MAXQDA. The findings demonstrated that the experimental group consistently outperformed the control group across all dimensions of engagement, with large effect sizes observed. In terms of writing performance, significant improvements were found, particularly in text organization and language use. These findings indicate that AI-supported collaborative writing can effectively enhance both student engagement and writing performance. Therefore, integrating AI tools such as ChatGPT into collaborative writing activities offers a promising pedagogical approach for EFL instruction at the secondary school level.