The increased consumption of diets high in saturated fats and refined sugars is a major public health concern in Western human societies. Recent studies suggest that perinatal exposure to dietary fat and/or sugar may affect behavioural development. We thus investigated the effects of perinatal exposure to a high-fat high-sugar diet (HFS) on behavioural development and production performance of piglets. Thirty-two non-obese sows and their piglets were allocated to 1 of 4 treatments in a 2 x 2 factorial design, with 8-week prenatal (gestation) and 8-week postnatal (lactation and post-weaning) exposure to a HFS diet (12% saturated fat, 18.5% sucrose, 1% cholesterol) or control low-fat low-sugar high-starch diets as factors. From weaning onwards (4 weeks of age), piglets were housed in group of 3 littermates (n = 8 groups/treatment) and fed ad libitum. After the end of the dietary intervention (8 weeks of age), all the piglets were fed a standard commercial diet. Piglet behaviours in the home pens were scored, and skin lesions, growth, feed intake and feed efficiency were measured up to 8 weeks after the end of the dietary treatment, i.e. until 16 weeks of age. At the end of the dietary treatment (8 weeks of age), response to novelty was assessed in a combined open field and novel object test (OFT/NOT). During the weeks following weaning, piglets fed the postnatal HFS diet tended to be less aggressive (p = 0.06), but exhibited more oral manipulation of pen mates (p = 0.05) than controls. Compared to controls, piglets fed the prenatal or postnatal HFS diet walked more in the home pen (p ≤ 0.05), and tended to have fewer skin lesions (p <0.10). Several behavioural effects of the postnatal HFS diet depended on the prenatal diet, with piglets subjected to a switch of diet at birth being more active, and exploring feeding materials, pen mates, and the environment more than piglets that remained on the same diet. Behaviours during the OFT/NOT were not affected by the diet. The intake of the postnatal HFS diet drastically reduced feed intake, but improved feed efficiency up to 8 weeks after the end of the dietary intervention, i.e. 16 weeks of age (p <0.0001 for both). Our study highlights the key role of prenatal and postnatal nutritional interactions for early behavioural development, and reveals programming effects of early life nutrition on voluntary feed intake of piglets later in life.