The present study aimed to investigate the relationship between math anxiety with optimism and perceived classroom structure through mediating role of mathematics attitudes in female high school students. The statistical population of this descriptive correlational study comprised all the female high-school students in Ahvaz (Iran) in the academic year 2020-2021. A sample of 237 students was randomly selected via single-stage cluster sampling. In this study, the sample size was determined based on the number of predictor variables in the structural equation analysis. The research instruments included the Mathematics Anxiety Rating Scale (MARS), the Life Orientation Test (LOT), Dundee Ready Education Environment Measure (DREEM), and the Mathematics Attitude Scale (MAS). The proposed model was evaluated by structural equation modeling (SEM). The results showed that all direct paths except perceived classroom structure to math anxiety were significant (p< 0.01). The indirect paths from optimism to math anxiety mediated by mathematics attitude, and the path from perceived classroom structure to math anxiety mediated by mathematics attitude were significant (p< 0.01). The proposed method, therefore, has an optimal fit and is a major step towards identifying the factor affecting students’ math anxiety.