Longitudinal electronic health records (EHRs) from primary care are scarce in low- and middle-income countries, and few have been made available to researchers in Latin America. We present DiabetIA, a longitudinal dataset derived from the primary care records of the Mexican Institute of Social Security (IMSS). The first release comprises 136,674 adults followed in six IMSS family medicine units in the state of Michoacan between 2005 and 2020, with more than 3.2 million visits summarized in 414,770 two-year windows with at least one visit. Each window includes demographics, ICD-10 diagnoses, anthropometry, vital signs, laboratory results and prescriptions, and type 2 diabetes diagnoses in the following year as prediction targets. At baseline, 24.4% of the patients had type 2 diabetes, 37.1% hypertension and 32.3% obesity. Technical validation assessed completeness, plausibility, consistency, temporal coverage and agreement with a state health survey. DiabetIA is freely available for download to support research on chronic disease trajectories and prediction in an underrepresented population.