Celiac disease exhibits a higher prevalence among patients with coronavirus disease 2019. However, the potential influence of COVID-19 on celiac disease remains uncertain. Considering the significant association between gut microbiota alterations, COVID-19 and celiac disease, the two-step Mendelian randomization method was employed to investigate the genetic causality between COVID-19 and celiac disease, with gut microbiota as the potential mediators. We employed the genome-wide association study to select genetic instrumental variables associated with the exposure. Subsequently, these variables were utilized to evaluate the impact of COVID-19 on the risk of celiac disease and its potential influence on gut microbiota. Employing a two-step Mendelian randomization approach enabled the examination of potential causal relationships, encompassing: 1) the effects of COVID-19 infection, hospitalized COVID-19 and critical COVID-19 on the risk of celiac disease; 2) the influence of gut microbiota on celiac disease; and 3) the mediating impact of the gut microbiota between COVID-19 and the risk of celiac disease. Our findings revealed a significant association between critical COVID-19 and an elevated risk of celiac disease (inverse variance weighted [IVW]: P = 0.035). Furthermore, we observed an inverse correlation between critical COVID-19 and the abundance of Victivallaceae (IVW: P = 0.045). Notably, an increased Victivallaceae abundance exhibits a protective effect against the risk of celiac disease (IVW: P = 0.016). In conclusion, our analysis provides genetic evidence supporting the causal connection between critical COVID-19 and lower Victivallaceae abundance, thereby increasing the risk of celiac disease.