With the significant advancements in technology and artificial intelligence (AI) algorithms and the substantial benefits that they offer in all fields, policymakers in the higher education sector, as in other sectors, have focused on the importance of adopting these technologies and benefiting from them as much as possible to improve the quality of services provided to students and enhance their academic performance. Based on this importance, the present study attempts to highlight the effect of AI on students’ academic performance (SAP), with the mediating role of service quality (SQ) in Algerian higher education institutions (HEIs). Data was collected utilizing an online questionnaire from a random sample consisting of 214 final-year master’s students in Science, Technology, Engineering, and Mathematics (STEM) disciplines at the University of Continuing Education in Saida, Algeria. The data was analyzed relying on the Structural Equation Modeling analysis (SEM) using the Jeffrey Amazing Statistics Program (JASP). The results of the study showed that AI has a direct and significant effect on SAP. Moreover, there is a statistically significant effect of AI on SQ. Furthermore, the results indicated that SQ, in turn, directly and positively affects SAP. Additionally, the findings revealed that SQ mediates the effect between AI and SAP. The study’s implications provide crucial insights for policy and decision makers in HEIs, highlighting that integrating AI applications into higher education is a valuable initiative to enhance SQ and SAP. Meanwhile, the research presents a set of recommendations that should be taken into account, most notably the urgent need to provide the necessary infrastructure for AI implementation to maximize its benefits, promote a culture of AI adoption, and encourage autonomy in administrative work within universities to reduce bureaucracy that hinders creativity and digital initiatives.