In this study, solid-phase extraction (SPE) combined with the dispersive liquid–liquid microextraction based on novel hydrophobic deep eutectic solvent (DLLME − DES) has been developed as an ultra-pre-concentration technique for the extraction of aflatoxin M1 (AFM1) in milk-based baby food (MBBF) and infant formula milk (IFM) samples followed by HPLC combined with fluorescence detection (HPLC − FL). In addition, carcinogenic and non-carcinogenic risk assessment was performed by health-related risk factors including liver cancer risk (LCR), margin of exposure (MOE) and target hazard quotient (THQ) were calculated using the mean of AFM1 in different infant food samples. The results of the study showed that the mean of AFM1 was statistically significant different between various brands and types of IFM and MBBF. The results of the study showed that the percentage of positive samples higher than the allowable limit of AFM1 in 36 samples of domestic infant formula milk (DIFM), 24 samples of imported infant formula milk (IIFM), 36 samples of domestic milk-based baby food (DMBBF) and 18 samples of imported milk-based baby food (IMBBF) were 41.6, 12.5, 66.7 and 33.3%, respectively. In addition, estimated values for health risk-related factors including LCR, MOE and THQ indicated that for most infants less than one-year-old were higher than the acceptable levels. Based on the results, it can be concluded that the quality of IFM and MBBF consumed in Iran in terms of AFM1 is poor. Therefore, it is necessary to take appropriate measures to reduce the amount of AFM1 in DIFM and DMBBF, and in addition, the IIFM and IMBBF should be controlled qualitatively before supplying the market.