The intestinal mucosa serves both as a conduit for the uptake of food-derived nutrients and microbiome-derived metabolites, and as a barrier that prevents tissue invasion by microorganisms and tempers inflammatory responses to the myriad contents of the lumen. How the intestine coordinates physiological and immune responses to food consumption to optimize nutrient uptake while maintaining barrier functions remains unclear. Here we show in mice how a gut neuronal signal triggered by food intake is integrated with intestinal antimicrobial and metabolic responses that are controlled by type-3 innate lymphoid cells (ILC3)1-3. Food consumption rapidly activates a population of enteric neurons that express vasoactive intestinal peptide (VIP)4. Projections of VIP-producing neurons (VIPergic neurons) in the lamina propria are in close proximity to clusters of ILC3 that selectively express VIP receptor type 2 (VIPR2; also known as VPAC2). Production of interleukin (IL)-22 by ILC3, which is upregulated by the presence of commensal microorganisms such as segmented filamentous bacteria5-7, is inhibited upon engagement of VIPR2. As a consequence, levels of antimicrobial peptide derived from epithelial cells are reduced but the expression of lipid-binding proteins and transporters is increased8. During food consumption, the activation of VIPergic neurons thus enhances the growth of segmented filamentous bacteria associated with the epithelium, and increases lipid absorption. Our results reveal a feeding- and circadian-regulated dynamic neuroimmune circuit in the intestine that promotes a trade-off between innate immune protection mediated by IL-22 and the efficiency of nutrient absorption. Modulation of this pathway may therefore be effective for enhancing resistance to enteropathogens2,3,9 and for the treatment of metabolic diseases.