Diabetes mellitus (DM) patients are more susceptible to urinary tract infections (UTIs) because persistent hyperglycemia causes glycosuria, creating a favorable environment for bacterial growth. Escherichia coli is the predominant pathogen responsible for most UTIs. However, the emergence of blaTEM-mediated antibiotic resistance has become a significant concern in healthcare management, as gene encodes ?-lactamases confer resistance by hydrolyzing ?-lactam antibiotics. Therefore, rapid molecular detection of the blaTEM gene is essential to support appropriate antimicrobial therapy. This study aimed to identify the blaTEM gene in E. coli isolated from the urine of patients with diabetes mellitus using the Polymerase Chain Reaction (PCR) method. A descriptive research design was employed. The study population consisted of 100 patients with diabetes mellitus at UPTD Puskesmas II East Denpasar, and 20 urine samples that met the inclusion criteria were selected for analysis. Urine specimens were cultured on Eosin Methylene Blue Agar (EMBA) for bacterial isolation, followed by PCR analysis to detect the blaTEM gene. The results showed that most respondents were aged 61-70 years (50%), male (55%), and had abnormal fasting blood glucose levels (?126 mg/dL) (75%). E. coli was isolated from five (25%) urine samples, as indicated by the characteristic metallic green colonies on EMBA. PCR analysis demonstrated that four of the five isolates (80%) were positive for the blaTEM gene, indicated by DNA bands ranging from 858 to 900 bp. In conclusion, the majority of E. coli isolates obtained from the urine of patients with diabetes mellitus carried the blaTEM gene, indicating the potential presence of resistance to ?-lactam antibiotics, particularly penicillins and cephalosporins. These findings highlight the importance of molecular detection for guiding appropriate antibiotic therapy and improving the management of urinary tract infections in patients with diabetes mellitus.