CD4 + T cells are the central element of the adaptive immune responses and protect the body from a variety of pathogens. Starting from naive cells, CD4 + T cells can differentiate into various effector cell subsets with specialized functions including T helper (Th) 1, Th2, Th17, regulatory T (Treg) and T follicular helper (Tfh) cells. Among them, Tregs and Th17 cells show a strong plasticity allowing the functional adaptation to various physiological and pathological environments during immune responses. Although they are derived from the same precursor cells and their differentiation pathways are interrelated, the terminally differentiated cells have totally opposite functions. Studies have shown that Tregs and Th17 cells have rather complex interplays in viral infection: Th17 cells may contribute to immune activation and disease progression while Tregs may inhibit this process and play a key role in the maintenance of immune homoeostasis, possibly at the cost of compromised viral control. In this review, we take respiratory syncytial virus (RSV), hepatitis B virus (HBV)/hepatitis C virus (HCV) and human immunodeficiency virus (HIV) infections as examples to discuss these interplays and their impacts on disease progression in viral infection. How to cite this article: Wan Z, Zhou Z, Liu Y, et al. Regulatory T cells and T helper 17 cells in viral infection. Scand J Immunol. 2020;91:e12873.