Medical students learning to use artificial intelligence for medical practices is likely to enhance medical services. However, studies in this area have been lacking. The present study investigated medical students’ perceptions of and behavioral intentions toward learning artificial intelligence (AI) in clinical practice based on the theory of planned behavior (TPB). A sum of 274 Year-5 undergraduates and master’s and doctoral postgraduates participated in the online survey. Six constructs were measured, including (1) personal relevance (PR) of medical AI, (2) subjective norm (SN) related to learning medical AI, (3) perceived self-efficacy (PSE) of learning medical AI, (4) basic knowledge (BKn) of medical AI, (5) behavioral intention (BI) toward learning medical AI and (6) actual learning (AL) of medical AI. Confirmatory factor analysis and structural equation modelling were employed to analyze the data. The results showed that the proposed model had a good model fit and the theoretical hypotheses in relation to the TPB were mostly confirmed. Specifically, (a) BI had a significantly strong and positive impact on AL; (b) BI was significantly predicted by PR, SN and PSE, whilst BKn did not have a direct effect on BI; (c) PR was significantly and positively predicted by SN and PSE, but BKn failed to predict PR; (d) both SN and BKn had significant and positive impact on PSE, and BKn had a significantly positive effect on SN. Discussion was conducted regarding the proposed model, and new insights were provided for researchers and practitioners in medical education.