Mucosal Th17 cells maintain the gut epithelial barrier and prevent invasion by luminal bacteria through a delicate balance of immunosuppressive and proinflammatory functions. HIV infection is characterized by mucosal Th17 depletion, microbial translocation, and immune activation. Therefore, we assessed the function of blood and sigmoid Th17 cells during both early and chronic HIV infection, as well as the impact of short- and long-term antiretroviral therapy. Th17 cells were defined as IL-17a+ CD4 T cells, and their functional capacity was assessed by the coproduction of the inflammatory cytokines IL-22, TNF-α, and IFN-γ, as well as the immunoregulatory cytokine IL-10. Gut Th17 cells had a much greater capacity to produce proinflammatory cytokines than did those from the blood, but this capacity was dramatically reduced from the earliest stages of HIV infection. Immunoregulatory skewing of mucosal Th17 cell function, characterized by an increased IL-10/TNF-α ratio, was uniquely seen during early HIV infection and was independently associated with reduced systemic immune activation. Antiretroviral therapy rapidly restored mucosal Th17 cell numbers; however, normalization of mucosal Th17 function, microbial translocation, and mucosal/systemic immune activation was much delayed. These findings emphasize that strategies to preserve or to more rapidly restore mucosal Th17 function may have important therapeutic benefit.