To investigate the prevalence of hepatitis B surface antigen (HBsAg), a seromarker for current infection of hepatitis B virus, in patients with ankylosing spondylitis (AS) from south China and to evaluate its association with human leukocyte antigen (HLA)-B27. The prevalence of HBsAg was retrospectively investigated in 439 patients with AS, 606 age- and sex-matched general individuals, 172 patients with other spondyloarthropathy (SpA), 698 patients with rheumatoid arthritis (RA), and 220 patients with osteoarthritis (OA). The positive rate of HBsAg in AS group was compared with those of the general population group and other disease groups, respectively, and the prevalence of HBsAg was compared between HLA-B27-positive and HLA-B27-negative patients with AS. The positive rate of HBsAg in AS patients, general population, other-SpA, RA, and OA patients were 25.39, 12.87, 14.53, 9.60, and 8.18%, respectively. The HBsAg prevalence of AS group was statistically higher than those of any other groups (P < 0.05). The prevalence of HBsAg in HLA-B27-positive and HLA-B27-negative AS patients were 26.68 and 14.49%, respectively, the positive rate of HBsAg in HLA-B27-positive AS patients was statistically higher than that of HLA-B27-negative AS patients (P < 0.05). The prevalence of HBsAg in AS patients was higher than those in general population, patients with other-SpA, RA, and OA. The high HBsAg prevalence in AS patients might be associated with their high frequency of HLA-B27 gene.