Background: Studies into ankylosing spondylitis (AS) and its relationship with immune function are controversial, and the correlation between the efficacy of TNF-α inhibitor and changes in immune function is unclear.Methods: A total of 40 immune cells were tested with flow cytometry, and the results of 105 HC (healthy control) subjects, 177 active-stage AS patients, and 23 AS cases before and after 12 weeks of TNF-α inhibitor therapy (Anbainuo) were analyzed.Results: Compared with the HC group, the proportion of immune cells, such as naïve and central memory CD4+T cells, in AS increased (p<0.0001), but effector memory and terminally differentiated CD4+T cells were decreased (p<0.01 and 0.0001, respectively). Naïve, central memory, and effector memory CD8+T cells were increased (p<0.0001, 0.001, and 0.01, respectively), but terminally differentiated CD8+T cells were decreased (p<0.0001). Th1 cells (helper T cells-1), Tfh1 cells (follicular helper T cells-1), Tc1 cells (cytotoxic T cells-1), and Tregs (regulatory T cells) were lower (p<0.01, 0.05, 0.0001, and 0.001, respectively), but Th17 cells, Tfh17 cells, and Tc cells were higher (p<0.001, 0.0001 and 0.001, respectively). The proportions of total B cells and class-switched B cells were increased (p<0.05), but non-switched B cells, plasma cells, memory B cells, and immature Bregs (regulatory B cells) were lower (p<0.01, 0.0001, 0.0001, and 0.0001, respectively). After Anbainuo therapy, the percentage of naïve CD4+ T cells had decreased (p<0.05) but Tregs and B10 cells (IL-10-producing regulatory B cells) had increased (p<0.01and 0.05, respectively), and the increase in Tregs was positively correlated with the decrease in CRP (C-reactive protein) (r= 0.489, p=0.018). Conclusions: We found that active-stage AS patients have an immunity imbalance involving multiple types of immune cells, including CD4+T cells, CD8+T cells, Th cells, Tfh cells, Tc cells, Tregs, Bregs, and B cells. TNF-α inhibitor Anbainuo can not only help to inhibit disease activity but can also improve the immune imbalance of CD4+ T cells and negative regulatory cells. But CD8 + T cells have not been rescued.