Objective: This study aimed to determine prevalence of anxiety and depression and associated factors in the general population of Iran during the COVID-19 pandemic. Method : We conducted this web-based cross-sectional study on 5328 individuals in Iran between 17th and 29th of April 2020. Data were collected using the convenience sampling method through an anonymous online questionnaire via social media like WhatsApp and Telegram. The online survey collected data on demographic variables, COVID-19-related variables, and symptoms of anxiety and depression. Anxiety and depression were assessed using the Generalized Anxiety Disorder-7 (GAD-7) and the Patient Health Questionnaire-9 (PHQ-9), respectively. Simple and multiple logistic regression analyses were performed to determine independent predictors of anxiety and depression. Results: The mean GAD-7 and PHQ-9 total scores were 7.17 (SD = 5.42) and 7.80 (SD = 6.68), respectively. Prevalence of anxiety, depression, and comorbid anxiety-depression were 30.1%, 33.4%, and 22.1%, respectively. According to the adjusted analysis, anxiety was significantly associated with female gender, being young and middle-aged, being unemployed or a housewife, having chronic diseases, spending considerable time thinking about COVID-19, having family members, friends, and/or relatives infected with COVID-19, and death of family members, relatives or friends due to COVID-19. Same results were also found for depression. Furthermore, depression was associated with being single, being resident in urban area, and having high risk individual in family. Conclusion: Prevalence of anxiety and depression were considerably higher in the general population of Iran during the COVID-19 pandemic. In addition, the findings suggest that more attention needs to be paid to vulnerable groups such as women, young/middle-aged adults, the unemployed, and people with chronic disease.