Objective. To estimate the prevalence of total, diagnosed and undiagnosed diabetes, and the prevalence of poor glycemic control in Mexico, and its associated factors. Materials and methods. Data from 3 700 adult participants were analysed in the 2016 National Health and Nutrition Survey. Diabetes prevalences were estimated with population weights, and the factors associated with total diabetes and poor glycemic control with Poisson regression models. Results The total prevalence of diabetes was 13.7% (9.5% diagnosed, 4.1% undiagnosed); 68.2% of people with diagnosed diabetes presented poor glycemic control. Longer disease duration, living in the centre or south of the country and being treated in pharmacies were associated with poor glycemic control. Being treated in a social security system was associated with better glycemic control. Conclusion. Multisectoral efforts are needed to strengthen screening, timely diagnosis and disease control, considering differences by region and type of health service.