Single nucleotide polymorphisms (SNPs) in the endoplasmic reticulum aminopeptidase (ERAP1 and ERAP2) genes are associated with the pathogenesis of bacterial and viral infections. To search for the variations in the ERAP1 and ERAP2 genes associated with tuberculosis (TB), 449 TB cases and 435 healthy individuals of the Han population in the Yunnan province of China were included in the present study. Eleven SNPs of ERAPs were genotyped using the SNaPshot SNP assay. Allelic, genotypic, and haplotypic association analyses were performed between the TB and control groups. Furthermore, stratification analyses among pulmonary TB (PTB), extrapulmonary TB (EPTB), and healthy controls; and initial treatment TB (ITTB), retreatment TB (RTB), and healthy controls were also performed. The TT genotype of rs26618 in ERAP1 exhibited a protective factor for TB, compared with the role of the CC/CT genotype (P = 0.003; OR = 1.490, 95% CI: 1.140-1.940). In ERAP2, the frequency of the G allele of rs2549782 was higher in the case group than in the control group (0.491 vs. 0.417, P = 0.002, OR = 1.350, 95% CI: 1.118-1.631), and the TT genotype exhibited a protective factor for TB, compared with the role of the GG/GT genotype (P = 0.001; OR = 1.650, 95% CI: 1.230-2.220). The frequency of the C allele of rs1056893 was higher in the case group than in the control group (0.468 vs. 0.394, P = 0.002, OR = 1.350, 95% CI: 1.118-1.631), and the genotype exhibited a difference in the log-additive model (P = 0.002; OR = 1.350, 95% CI: 1.120-1.630). The frequencies of the haplotype rs27037-rs27044-s30187-rs26618-rs26653-rs3734016-GCCCGC in ERAP1 (0.290 vs. 0.240, P-adj = 0.028, OR = 1.320, 95% CI: 1.063-1.638) and the haplotypes rs2549782-rs2248374-rs2287988-rs1056893-GTAGC in ERAP2 (0.446 vs. 0.348, P-adj = 4.80E-05, OR = 1.510, 95% CI: 1.246-1.829) was higher in the TB groups, while the frequencies of the haplotypes rs2549782-rs2248374-rs2287988-rs1056893-TAGAT (0.478 vs. 0.539, P-adj = 0.020, OR = 0.782, 95% CI: 0.649-0.943) were lower in the TB groups. The allelic and genotypic associations were also investigated in the subsequent stratification between the PTB, EPTB and control groups as well as between the ITTB, RTB, and control groups. In conclusion, variations in ERAP1 and ERAP2 genes were identified to be associated with TB in the Han Chinese population.