Stenotrophomonas maltophilia is a common nosocomial pathogen that causes high morbidity and mortality. Because of its inherent extended antibiotic resistance, therapeutic options for S. maltophilia are limited, and sulfamethoxazole/trimethoprim (SXT) is the only first-line antimicrobial recommended. However, with the spread of dihydropteroate synthase (sul1 and sul2) genes, global emergence of SXT resistance has been reported. There is an urgent need to develop a rapid and sensitive but cost-efficient method to monitor the dissemination of sul genes. In this study, we developed loop-mediated isothermal amplification (LAMP) assays for sul1 and sul2 using real-time turbidity and hydroxy naphthol blue coloration methods. The assays could quickly detect sul genes with high sensitivity and specificity. The LAMP detection limit was 0.74 pg/reaction of extracted genomic DNA for sul1 and 2.6 pg/reaction for sul2, which were both 10-fold more sensitive than the corresponding traditional PCR assays. Additionally, the LAMP assays could positively amplify DNA from sul1-producing strains, but not from the negative controls. We then used the LAMP assays to investigate the dissemination of sul genes among S. maltophilia isolates from patients in three hospitals in Beijing, China. Among 450 non-duplicated samples collected during 2012–2014, 56 (12.4%) strains were SXT-resistant. All these SXT-resistant strains were positive for sul genes, with 35 (62.5%) carrying sul1, 17 (30.4%) carrying sul2, and 4 (7.1%) carrying both sul1 and sul2, which indicated that sul genes were the predominant resistance mechanism. Of 394 SXT-susceptible strains, 16 were also sul-positive. To provide epidemiological data for the appropriate choice of antimicrobials for treatment of sul-positive S. maltophilia, we further tested the susceptibility to 18 antimicrobials. Among these, sul-positive strains showed the highest susceptibility to tetracycline derivatives, especially minocycline (MIC50/MIC90, 0.5/4; susceptibility rate, 95.4%). Ticarcillin-clavulanate and new fluoroquinolones (moxifloxacin and levofloxacin) also showed some in vitro activity. Apart from these three kinds of antimicrobials, other agents showed poor activity against sul-positive strains.