Objetivo: determinar factores asociados a la adherencia al tratamiento en pacientes con diabetes mellitus tipo 2 en un establecimiento del primer nivel de atención, San Martin de Porres 2023. Materiales y métodos: enfoque cuantitativo, diseño transversal, alcance correlacional. La muestra se conformó por 89 pacientes con diabetes mellitus tipo 2. El instrumento fue una ficha de recolección de datos validada para el estudio y el cuestionario de Morisky Green para evaluar la adherencia. Resultados: el 68,5%(n=61) fueron femenino, 52,8%(n=47) tuvieron secundaria, 65,2%(n=58) fueron convivientes, 55,1%(n=49) tuvieron SIS. El 52,8%(n=47) tuvo entre 0 a 5 años de enfermedad, 31,5%(n=28) tenía hipertensión arterial y 4,5%(n=4) dislipidemia. 65,2%(n=58) consumía de 1 a 2 medicamentos. Un 94,4%(n=84) pertenecen a un club de pacientes con diabetes, 62,9%(n=56) ha recibido educación sobre diabetes en el último año, 53,9%(n=48) no le resulta fácil conseguir una cita para el control de su diabetes. El 68.5%(n=61) fueron adherentes, y el 31.5%(n=28) fueron no adherentes. Conclusiones: hubo asociación significativa entre los factores grado de instrucción, número de medicamentos, padecer una enfermedad, pertenecer a un club de diabetes, haber recibido educación sobre diabetes.