Cytochrome P450 2D (CYP2D) is important in psychopharmacology as it is engaged in the metabolism of drugs, neurosteroids and neurotransmitters. An unbalanced maternal diet during pregnancy and lactation can cause neurodevelopmental abnormalities and increases the offspring's predisposition to neuropsychiatric diseases. The aim of the present study was to evaluate the effect of maternal modified types of diet: a high-fat diet (HFD) and high-carbohydrate diet (HCD) during pregnancy and lactation on CYP2D in the liver and brain of male offspring at 28 (adolescent) or 63 postnatal days (young adult). The CYP2D activity and protein level were measured in the liver microsomes and the levels of mRNAs of CYP2D1, 2D2 and 2D4 were investigated both in the liver and brain. In the liver, both HFD and HCD increased the mRNA levels of all the three investigated CYP2D genes in adolescents, but an opposite effect was observed in young adults. The CYP2D protein level increased in adolescents but not in young adults. In contrast, young adults showed significantly decreased CYP2D activity. Similar effect of HFD on the CYP2D mRNAs was observed in the prefrontal cortex, while the effect of HCD was largely different than in the liver (the CYP2D2 expression was not affected, the CYP2D4 expression was decreased in young adults). In conclusion, modified maternal diets influence the expression of individual CYP2D1, CYP2D2 and CYP2D4 genes in the liver and brain of male offspring, which may affect the metabolism of CYP2D endogenous substrates and drugs and alter susceptibility to brain diseases and pharmacotherapy outcome.