Rotavirus infection causes severe dehydrating diarrhoea in young children and is a leading cause of infant hospitalization. Here, Zhang et al. demonstrate that bacterial flagellin can protect mice from infection with rotavirus and cure mice with chronic infection. These effects are mediated through activation of Toll-like receptor 5 and NOD-like receptor C4 on dendritic cells, leading to the production of interleukin-22 (IL-22) and IL-18, respectively. In mice, co-administration of these cytokines confers complete protection against a broad range of rotavirus inoculation and eliminates established infection within 24 hours.