ImportanceThe long-term consequences of COVID-19 on mental health are a critical issue given the number of people infected with SARS-CoV-2 worldwide since the beginning of the pandemic.ObjectiveTo investigate the associations between self-reported COVID-19–like symptoms or SARS-CoV-2 seropositivity and subsequent depression or anxiety.Design, Setting, and ParticipantsThis propensity score–matched cohort study began in May 2020, with follow-ups in November 2020 and July 2021. The study used data from a large, randomly selected, national population–based cohort from France, the EpiCoV (Epidémiologie et Conditions de Vie) study. Of 85 074 individuals 15 years or older who completed the questionnaires at the 3 collection times, 28 568 were excluded because they did not return a blood sample for serologic testing, 1994 because of missing data on outcomes or exposures, and 9252 to respect the temporal sequence (exposure must precede the outcome).ExposuresPropensity scores based on various socioeconomic, lifestyle, and health variables were computed to match participants who experienced COVID-19–like symptoms between February and November 2020 or showed SARS-CoV-2 seropositivity in November 2020.Main Outcomes and MeasuresLogistic regression models were used to estimate associations between these occurrences and depression or anxiety assessed in July 2021 using the Patient Health Questionnaire 9-item and Generalized Anxiety Disorder 7-item scales, respectively.ResultsAmong the 45 260 included participants (mean [SD] age, 51.1 [18.9] years; 52.4% women; 8.0% with depression and 5.3% with anxiety in July 2021), COVID-19–like symptoms were associated with subsequent depression (adjusted odds ratio, 1.70; 95% CI, 1.45-1.99) and anxiety (adjusted OR, 1.57; 95% CI, 1.29-1.92), whereas SARS-CoV-2 seropositivity was not. Furthermore, COVID-19–like symptoms, but not anosmia or dysgeusia alone, were associated with subsequent depression and anxiety in both the seropositive and seronegative subgroups.Conclusions and RelevanceIn this cohort study of more than 45 000 individuals drawn from the French general population, SARS-CoV-2 infection was not found as a risk factor of subsequent depression or anxiety. Moreover, self-reported COVID-19–like symptoms were associated with depression and anxiety assessed at least 8 months later in both seropositive and seronegative subgroups, suggesting that factors other than SARS-CoV-2 infection are implied in this association.