Initial events after exposure determine HIV-1 disease progression, underscoring a critical need to understand host mechanisms that interfere with initial viral replication. Although associated with chronic HIV-1 control, it is not known whether interleukin-21 (IL-21) contributes to early HIV-1 immunity. Here we take advantage of tractable primary human lymphoid organ aggregate cultures to show that IL-21 directly suppresses HIV-1 replication, and identify microRNA-29 (miR-29) as an antiviral factor induced by IL-21 in CD4 T cells. IL-21 promotes transcription of all miR-29 species through STAT3, whose binding to putative regulatory regions within the MIR29 gene is enriched by IL-21 signalling. Notably, exogenous IL-21 limits early HIV-1 infection in humanized mice, and lower viremia in vivo is associated with higher miR-29 expression. Together, these findings reveal a novel antiviral IL-21-miR-29 axis that promotes CD4 T-cell-intrinsic resistance to HIV-1 infection, and suggest a role for IL-21 in initial HIV-1 control in vivo.