Introduction: Psychological factors play a key role in people's emotional responses to different social situations. Objective: This study aimed to investigate the mediating role of defense mechanisms in the relationship between social phobia and alexithymia, in the students of Farhangian University, Sari City, Iran. Materials and Methods: This was an analytical, correlational study that specifically used structural equation modeling. The statistical population included all students of the Farhangian University of Sari city, Iran, in the academic year of 2019-2020. A sample of 234 people was recruited with the available sampling method. The social phobia inventory, defense mechanism questionnaire, and Toronto alexithymia scale were used to measure the research variables. Finally, the proposed model was evaluated using structural equation modeling. Results: The results showed that social phobia variables, undeveloped defensive mechanisms, and psychotic defensive mechanisms are positively correlated with alexithymia. Also, there is a significant negative correlation between developed defensive style and alexithymia (P = 0.001). The results indicated significant correlations of social phobia (r = 0.28), undeveloped defensive style (r = 0.31), psychotic defensive style (r = 0.28), and developed defensive style (r = -0.30) with alexithymia (P = 0.001). Moreover, the research model was approved: defensive mechanisms mediate the relationship between social phobia and alexithymia in the students. The defensive mechanisms and social phobia affect 48% of the alexithymia variable. Conclusion: The students with adaptive defensive mechanisms experience lower social phobia and alexithymia symptoms. Also, social phobia indirectly affects alexithymia through the mediating role of defense mechanisms.