Diabetes-induced oxidative stress plays a critical role in the mobilisation of endothelial progenitor cells (EPCs) from the bone marrow to the circulation. This study was designed to explore the effects of chronic melatonin administration on the promotion of the mobilisation of EPCs and on the preservation of erectile function in type I diabetic rats. Melatonin was administered to streptozotocin-induced type I diabetic rats. EPCs levels were determined using flow cytometry. Oxidative stress in the bone marrow was indicated by the levels of superoxide dismutase and malondialdehyde. Erectile function was evaluated by measuring the intracavernous pressure during an electrostimulation of the cavernous nerve. The density of the endothelium and the proportions of smooth muscle and collagen in the corpus cavernosum were determined by immunohistochemistry. The administration of melatonin increased the superoxide dismutase level and decreased the malondialdehyde level in the bone marrow. This effect was accompanied by an increased level of circulating EPCs in the diabetic rats. The intracavernous pressure to mean arterial pressure ratio of the rats in the treatment group was significantly greater, compared with diabetic control rats. The histological analysis demonstrated an increase in the endothelial density of the corpus cavernosum after the administration of melatonin. However, melatonin treatment did not change the proportions of smooth muscle and collagen in the corpus cavernosum of diabetic rats. Chronic administration of melatonin has a beneficial effect on preventing erectile dysfunction (ED) in type I diabetic rats. Promoting the mobilisation of EPCs is one of the possible mechanisms involved in the improvement of ED.