Orexin A (OXA) and B (OXB) are hypothalamic neuropeptides identified as regulators of food intake, energy homoeostasis, sleep–wake cycle and arousal. They also create an integrative link between energy homoeostasis and reproduction. Although their functions in the ovaries and testes have been partially explored, to date, less attention has been focused on the role of the peptides in the uterus. The aim of this study was to investigate the effect of one of orexins – orexin B on oestradiol (E2), oestrone (E1) and testosterone (T) secretion by porcine endometrial and myometrial slices as well as the gene expression of key steroidogenic enzymes responsible for steroid production (CYP17A1, CYP19A3) during the luteal phase of the oestrous cycle (days 10 to 11) and early pregnancy (days 10 to 11, 12 to 13, 15 to 16, 27 to 28). Orexin B suppressed E2 secretion by endometrial slices on days 10 to 11 and 15 to 16 of pregnancy, and days 10 to 11 of the cycle. In the myometrium, OXB inhibited E2 production on days 10 to 11 of pregnancy, whereas on days 12 to 13 it enhanced steroid output. Endometrial E1 release was potentiated by the peptide during all studied periods of the cycle and pregnancy, with the exception of days 12 to 13, when an inhibitory effect was observed. Myometrial secretion of E1 was increased, except on days 27 to 28. Testosterone secretion by endometrial slices was increased on days 12 to 13 and 27 to 28 of pregnancy. On days 10 to 11 of the cycle, T release was stimulated in response to the lowest and decreased under the influence of the highest dose of OXB. In the myometrium, T production was inhibited by OXB on days 10 to 11 of pregnancy and during the corresponding period of the cycle. On days 27 to 28 of pregnancy, T release was potentiated by the lowest dose of OXB. Expression of both genes was modified by OXB depending on the period of pregnancy and the type of examined uterine tissues. Our findings suggest that OXB, through modulation of uterine steroidogenesis, may have a regulatory role in the uterus.