Antimicrobial resistance (AMR) emergence in commensal and pathogenic bacteria is a global health issue. House flies (Musca domestica) are considered as biological and mechanical vectors for pathogens causing nosocomial infections, including methicillin-resistant Staphylococcus aureus (MRSA). However, the prevalence of antimicrobial resistance and the role of temperature on the occurrence of Staphylococcus aureus and MRSA in house flies in a hospital environment have not been studied. A total of 400 house flies were collected in winter and summer from four hospital-associated areas in Mymensingh, Bangladesh. Detection of S. aureus and MRSA in flies was done by culturing, staining, and PCR methods targeting nuc and mec genes (mecA and mecC), respectively. Disc diffusion test was used to detect resistance phenotype against six antimicrobials. Logistic regression models were constructed to assess the effect of temperature on the frequency of antimicrobial resistance, and on the presence of the nuc and mecA genes, and location of samples in and around a hospital environment. By PCR, S. aureus was detected in 208 (52%) samples. High frequencies of resistance (≥ 80% of isolates) to amoxicillin, azithromycin, and oxacillin were observed by disk diffusion test. Increase in temperature had a positive effect on the occurrence of S. aureus and MRSA isolates as well as on their resistance to individual and multiple antimicrobials. Among the study areas, hospital premises had increased odds of having S. aureus. Increased temperature of summer significantly increased the occurrence of MRSA in house flies in and around the hospital environment, which might pose a human and animal health risk.