Background The COVID-19 pandemic has had a major impact on mental health of healthcare workers. However, studies in primary care workers are scarce. Aim To investigate the prevalence and associated factors of psychological distress in primary care workers during the first COVID-19 outbreak. Design and setting A multicenter, cross-sectional, web-based survey conducted in primary healthcare workers in Spain, between May and September 2020. Method Healthcare workers were invited to complete a survey to evaluate sociodemographic and work-related characteristics, infection status and exposure to COVID-19 infected patients, resilience (Connor-Davidson Resilience Scale), in addition to being screened for common mental disorders (depression, anxiety disorders, post-traumatic stress disorder, panic attack and substance use disorder). Positive screening for any of the aforementioned disorders was analyzed globally defining it as "any current mental disorder". Results A total of 2,928 primary care professionals participated in the survey. Of them, 43.7% (CI95%:41.9– 45.4) tested positive for a mental disorder. Being a woman (OR:1.61; 95%CI:1.25–2.06), previous mental disorders (OR:2.58; 95%CI: 2.15–3.10), greater occupational exposure to COVID-19 patients (OR:2.63; 95%CI:1.98–3.51), being a woman with children or dependents under their care (respectively, OR:1.35; 95%CI:1.04-1.76; and OR:1.59; 95%CI:1.20-2.11), or an administrative job (OR:2.24; 95%CI:1.66–3.03) were associated with a higher risk of any current mental disorder. Personal resilience was shown to be a protective factor. Conclusion Almost half of primary care workers showed significant psychological distress. Establishing support strategies for mental health of primary care workers is necessary, by designing psychological support and resilience-building interventions based on the identified risk factors.