Brucellosis remains a major zoonosis worldwide. Brucella antigens induce the production of T-helper 1 (Th1) cytokines such as interleukin-12 (IL-12) in humans. We aimed to investigate the association of two single nucleotide polymorphisms (SNPs) in the gene encoding the IL-12p40 cytokine (IL-12B) with brucellosis and to examine the functionality of these SNPs through measuring serum levels of IL-12p40. We genotyped IL-12B gene rs3212227, A>C; rs6887695 G>C polymorphisms in a case-control study on a total of 281 subjects including 153 patients with active brucellosis and 128 healthy controls, using RFLP and serum IL-12p40 levels, were assessed by ELISA. The rs3212227 minor allele (C) and homozygote genotype (CC) were more frequent in controls compared with patients with brucellosis (P = 0.006, OR = 0.608, 95%CI = 0.429–0.861 for the C allele; P = 0.024, OR = 0.443, 95% CI: 0.218–0.900 for the CC genotype). Comparison of IL-12B genotypes and serum levels of the IL-12p40 revealed that rs3212227 AA genotype, with higher frequency in patients than in controls, was associated with increased levels of the cytokine (P = 0.0001). Furthermore, the distribution of haplotype and genotype combinations in our study suggested that rs3212227C/rs6887695C haplotype or CC/GC or CC/CC genotype combinations may protect controls against Brucella infection by contributing to a functional downregulation of the serum IL-12p40 production in vivo, as shown by ELISA (P < 0.05). Overall, our study demonstrated that rs3212227 A variant was associated with higher levels of serum IL-12p40 and could possibly contribute to an inherited predisposition to brucellosis.