In this research article, a novel and green deep eutectic solvent-based microextraction (DES-ME) procedure based on chemometric-assisted (CA) optimization was developed for the extraction of caffeine in foods and beverages prior to its spectrophotometric determination. Ultrasound was used to accelerate the extraction of caffeine. Deep eutectic solvents (DES), prepared in an ultrasonic bath at 20-60 min for 60-80 degrees C, were used as extraction solvents. The important experimental variables (pH, DES amount, temperature, sonication time and metal concentration) were modelled and optimized using response surface methodology (RSM) based on central composite design (CCD). Under the optimum conditions, the proposed method allowed the determination of caffeine with limits of detection (LOD, 3s(blank)/m) and quantification (LOQ, 3s(blank)/m) of 7.5 and 25.0 mu g L-1, respectively. For 40 mu g L-1 and 100 mu g L-1 of caffeine (n = 5), relative standard deviations (RSDs%) and recoveries% were 1.2-1.6% and 96.7-98.2%, respectively. Validation studies (accuracy, precision, trueness, reliability and selectivity) of the method were performed before the analysis of real samples. The results showed that the combination of the CCD with the DES-ME can be considered as a new perspective for the extraction and determination of caffeine in foods and beverages.