The antibiotic, trimethoprim-sulfamethoxazole (TMP-SMX), is generally used for prophylaxis in HIV individuals to protect them from Pneumocystis jiroveci infection. Long-term use of TMP-SMX develops drug resistance among bacteria in HIV patients. The study was aimed to detect the TMP-SMX resistance genes among gram-negative bacteria from HIV patients. TMP-SMX-resistant isolates were detected by the Kirby-Bauer disc diffusion method. While TMP resistance genes such as dfrA1, dfrA5, dfrA7, and dfrA17 and SMX resistance genes such as sul1 and sul2 were detected by multiplex PCR, class 1 and class 2 integrons were detected by standard monoplex PCR. Of the 151 TMP-SMX-resistant bacterial isolates, 3 were positive for sul1 alone, 48 for sul2 alone, 11 for dfrA7 alone, 21 for sul1 and sul2, 1 for sul1 and dfrA7, 23 for sul2 and dfrA7, 2 for sul2 and dfrA5, 41 for sul1, sul2, and dfrA7, and 1 for sul2, dfrA5, and dfrA7. Of 60 TMP-SMX-resistant isolates positive for integrons, 44 had class 1 and 16 had class 2 integrons. It was found that the prevalence of sul genes (n = 202; p