Nurses play a pivotal role in the delivery of medical services. Professional commitment is crucial for nursing professionals’ long-term, healthy, and sustainable development. However, nursing students’ professional commitment levels are currently unsatisfactory in China, especially given that the COVID-19 pandemic has posed unprecedented challenges to the profession. Therefore, studies investigating the professional commitment levels of nursing students and the underlying influencing factors are urgently required. This study explored how nursing students’ risk perceptions, negative emotions, and psychological capital affected their professional commitment during the COVID-19 pandemic. A cross-sectional study was conducted among nursing students using risk perception, professional commitment, negative emotions, and psychological capital scales. An analysis of 1142 Chinese nursing students suggested that nursing students’ risk perception positively impacted professional commitment and that negative emotions mediated this association. Importantly, psychological capital moderates the mediating effect of negative emotions and can buffer the negative emotions caused by risk perception. This study demonstrated that effective intervention strategies should be implemented in multiple dimensions such as education, individual, public and society to improve the professional commitment of nursing students.