BACKGROUND: All site-specific interactions between HIV type-1 (HIV-1) subtype, human leukocyte antigen (HLA)-associated immune selection and integrase inhibitor resistance are not completely understood. We examined naturally occurring polymorphisms in HIV-1 integrase sequences from 342 antiretroviral-naive individuals from the Western Australian HIV Cohort Study and the Swiss HIV Cohort Study. METHODS: Standard bulk sequencing and sequence-based typing were used to generate integrase sequences and high-resolution HLA genotypes, respectively. Viral residues were examined with respect to drug resistance mutations and CD8(+) T-cell escape mutations. RESULTS: In both predominantly subtype B cohorts, 12 of 38 sites that mediate integrase inhibitor resistance mutations were absolutely conserved, and these included the primary resistance mutations. There were 18 codons with non-primary drug resistance-associated substitutions at rates of up to 58.8% and eight sites with alternative polymorphisms. Five viral residues were potentially subject to dual-drug and HLA-associated immune selection in which both selective pressures either drove the same amino acid substitution (codons 72, 157 and 163) or HLA alleles were associated with an alternative polymorphism that would alter the genetic barrier to resistance (codons 125 and 193). The common polymorphism T125A, which was characteristic of non-subtype B and was also associated with carriage of HLA-B*57/*5801, increased the mutational barrier to the resistance mutation T125K. CONCLUSIONS: Primary integrase inhibitor resistance mutations were not detected in the absence of drug exposure in keeping with sites of high constraint. Viral polymorphisms caused by immune selection and/or associated with non-subtype B might alter the genetic barrier to some non-primary resistance-associated mutations.