Medication adherence by patients with diabetes is critical, as it plays a crucial role in individuals’ long-term health and well-being. We evaluated the medication adherence, illness perception, diabetes knowledge, and associated factors among patients with type 2 diabetes mellitus (T2DM) attending primary health centers (PHCs) in the eastern province of the Kingdom of Saudi Arabia (KSA) using a validated Arabic version of a data collection form. In order to identify the variables that are associated with medication adherence, we applied a logistic regression analysis. Furthermore, we performed the Spearman test to find the correlation between medication adherence, illness perception, and diabetes knowledge. Of the 390 studied patients, 21.5% had low medication adherence, and it was significantly associated with gender (adjusted OR (AOR) = 1.89, 95% CI = 1.27–2.73,p= 0.003) and duration of diabetes (AOR = 0.83, 95% CI = 0.67–0.95,p= 0.017). Furthermore, we found a significant positive correlation between medication adherence and illness perception (rho = 0.217,p= 0.007) and knowledge of diabetes and medication adherence (rho = 0.425,p< 0.001). We recommend improving T2DM patients’ knowledge about the importance of adherence to their medication regimen in several health education sessions at the PHCs. In addition, we recommend mixed-method medication adherence assessment surveys in different parts of the KSA.