Although widely studied as a neurotransmitter, T cell–derived acetylcholine (ACh) has recently been reported to play an important role in regulating immunity. However, the role of lymphocyte-derived ACh in viral infection is unknown. Here, we show that the enzyme choline acetyltransferase (ChAT), which catalyzes the rate-limiting step of ACh production, is robustly induced in both CD4+ and CD8+ T cells during lymphocytic choriomeningitis virus (LCMV) infection in an IL-21–dependent manner. Deletion of Chat within the T cell compartment in mice ablated vasodilation in response to infection, impaired the migration of antiviral T cells into infected tissues, and ultimately compromised the control of chronic LCMV clone 13 infection. Our results reveal a genetic proof of function for ChAT in T cells during viral infection and identify a pathway of T cell migration that sustains antiviral immunity.