Using a unique cohort of study participants undergoing surgical lung resections as treatment for ongoing or previous TB infection, we characterize T cells isolated from lung tissues in comparison with matched blood from the same donor and find they express Trm markers, are highly functional, are enriched for IL-17–producing subsets, and are partially impaired by HIV coinfection. This evidence concerns the gene IL17A and coinfection.