Objectives: To evaluate the adherence to medication in patients with type 2 diabetes mellitus and to assess its impact on the disease-oriented outcomes. Type of study: Cross-sectional. Location: Porto, Portugal. Population: Patients with type 2 diabetes mellitus from a primary care setting. Methods: A convenience sample of patients regularly attending a primary care setting, from July to October 2017, answered anonymously a survey delivered by their family physician. Adherence was assessed by the Treatment Adherence Measure questionnaire. Other evaluated variables were demographic and psychosocial factors and disease-oriented outcomes (weight, height, glycated hemoglobin, and blood pressure). Results: Eighty-five patients completed the study (54.1% of females) with a mean age of 61.3 years (± 13.8 years). The proportion of patients presenting good adherence to medication was 62.3% (CI95%, 51.8-72.9%). The lowest adherence is more common in patients with depressive symptoms (p=0.004), history of smoking habits (p=0.019), living alone (p=0.009) or living without a marital partner (p=0.039), and it is associated with higher glycated hemoglobin levels (p=0.004). Conclusions: Poor adherence to medication is a significant problem in the diabetic population, leading to lower glycemic control rates. The identification of its determinants allows us to design a specific intervention in primary care, both in patients' education and in therapeutic approach, able to improve their health outcomes.