BACKGROUND: To address the challenges presented by an aging population, there is a high demand for a skilled nursing workforce. Nursing students, once considered auxiliary to the clinical nursing team, are now essential. However, there is a noticeable lack of willingness among nursing students to engage in geriatric care. Hence, this study investigated the impact of professional values and ageism on nursing students' intentions toward geriatric care, as well as the mediating role of attitudes in the relationship between professional values, ageism, and the willingness to practice geriatric care. METHOD: This cross-sectional study involved administering a sociodemographic data questionnaire, and using a revised Nursing Professional Values Scale, an ageism scale, and a revised Kogan's Attitudes toward Old People scale. In total, 706 nursing students in Chongqing participated. We analysed the data using chi-squared analysis, t-tests, and binary logistic regression. To explore the mediating effect of nursing students' attitudes toward older adults, we constructed a mediation model and conducted a path analysis. RESULTS: In the study, 68% of participants expressed a willingness to pursue geriatrics. Positive correlations were found between this willingness and prior involvement in activities related to older adults, experience in caring for older adults, and prior clinical practice in geriatric wards. The path analysis revealed that attitudes toward older adults partially mediated the effect of professional values on geriatric care willingness. While ageism did not directly influence this willingness, it exerted an indirect influence through the attitudes of nursing students toward older adults. CONCLUSIONS: The attitudes of nursing students fully mediated the relationship between ageism and their willingness to engage, while only partially mediating the relationship between their professional values and willingness. It is imperative for nursing educators to focus on reducing potential ageism among nursing students, enhancing their exposure to geriatric care, and incorporating training on professional values into nursing curricula.