The PREMEDI study was designed to assess the efficacy of nutritional counseling aimed at promoting Mediterranean Diet (MD) during pregnancy on the incidence of overweight or obesity at 24 months in the offspring. PREMEDI was a parallel-arm randomized-controlled trial. 104 women in their first trimester of pregnancy were randomly assigned in a 1:1 ratio to standard obstetrical and gynecological care alone (CT) or with nutritional counseling promoting MD. Women enrolled in the MD arm were provided with 3 sessions of nutritional counseling (one session per trimester). The main outcome was the proportion of overweight or obesity among the offspring at the age of 24 months. Maternal MD-adherence and weight gain during pregnancy were also evaluated. Lastly, the evaluation of epigenetic modulation of metabolic pathways in the offspring was analyzed in cord blood. Five women in the MD arm and 2 in the CT arm were lost to follow-up, so a total of 97 completed the study. At 24 months, children of MD mothers were less likely to have overweight or obesity than those of the CT mothers (6% vs. 33%, absolute risk difference = -27%, 95% CI -41% to -12%, p < 0.001; number needed to treat 3, 95% CI 2 to 8, intention to treat analysis). A significantly higher increase of MD-adherence during the trial was observed in the MD arm compared to the CT arm. A similar body weight gain at the end of pregnancy was observed in the two arms. The mean (SD) methylation rate of the leptin gene in cord blood was 30.4 (1.02) % and 16.9 (2.99) % in the CT and MD mothers, respectively (p < 0.0001). MD during pregnancy could be an effective strategy for preventing pediatric overweight or obesity at 24 months. This effect involves, at least in part, an epigenetic modification of leptin expression.