Type 2 diabetes mellitus is a non-communicable disease and is a major chronic and long-term health problem in society. If uncontrolled, it tends to worsen due to complications. Diabetes mellitus requires long-term treatment. This study aims to determine the factors that affect adherence to pharmacological treatment of type 2 diabetes mellitus in farmers. This study used a quantitative method with a cross-sectional approach. The sample size was 165 farmers who were selected by purposive sampling. This study was conducted from May to June 2024 in the working area of Sukadamai Community Health Center, Natar, South Lampung, Indonesia. Data were collected based on questionnaires. The results showed that adherence to pharmacological treatment of type 2 diabetes mellitus is directly related to age (b=-1.601; 95%CI=-3.260-0.583; p=0.059), self-motivation (b=2.500; 95%CI=0.856-4.144; p=0.003), duration of illness (b=1.587; 95%CI=0.209-0.964; p=0.024), and family support (b=2.840; 95%CI=1.311-4.369; p=0.000). There is an indirect relationship between education and adherence through the knowledge variable (b=0.962; 95%CI=0.307-1.617; p=0.004). Indirectly, education is related to adherence through income (b=2.363; 95%CI=1.618-3.107; p=0.000), self-efficacy to adherence through self-motivation (b=0.261; 95%CI=-0.657-1.180; p=0.577), and family support through self-motivation (b=2.287; 95%CI=1.361-3.214; p= 0.000). Healthcare workers should repeatedly provide counseling on primary education materials, such as the importance of continuous control, pharmacological and non-pharmacological interventions, and other secondary prevention measures to prevent complications in patients diagnosed with type 2 diabetes mellitus.