Diabetes mellitus (DM) is a chronic disease that will last a lifetime. Compliance with taking medication plays a very important role in the success of DM treatment therapy to maintain blood sugar levels within the normal range. There are various factors that can influence the level of compliance with DM treatment. This study aims to evaluate the level of compliance and analyze factors that influence treatment compliance in patients with type 2 diabetes mellitus at the Kotagede II Yogyakarta Community Health Center. This research is a type of quantitative research with a cross sectional approach. This data was obtained from primary data (questionnaire) and secondary data (medical records). The population in this study was type 2 DM patients at Puskesmas II Kotagede Yogyakarta. Samples were obtained using a purposive sampling method based on the inclusion criteria: patients diagnosed with type 2 DM outpatient at the Kotagede II Community Health Center, had received diabetes drug therapy for at least the last 3 months, had laboratory data on fasting and/or intermittent blood sugar levels, were willing to be respondents. Compliance factors evaluated in this study were level of knowledge, attainment of blood sugar levels, insurance, frequency of taking medication, therapy regimen (monotherapy or combination), and length of suffering. The level of adherence was measured using the Medication Adherence Rating Scale (MARS) questionnaire while the level of knowledge used the Diabetes Knowledge Questionnaire (DKQ) questionnaire. The data were analyzed descriptively and to determine the factors that influenced compliance, the chi square test and multivariate test (logistic regression) were used. Based on research results from 106 respondents, the majority, namely 79 respondents (74.5%) had a moderate level of compliance. Factors that influence the level of treatment compliance of type 2 DM patients at the Kotagede II Yogyakarta Community Health Center are blood sugar levels (p-value = 0.000; OR = 12.387) and knowledge (p-value = 0.012). Blood sugar levels are the factor that most influences the level of treatment compliance for type 2 DM patients at the Kotagede II Yogyakarta Community Health Center.