Aims. Cavernosal endothelial dysfunction is one of the factors in developing diabetic erectile dysfunction (DED), but the mechanism of cavernosal endothelial dysfunction is unclear. The present study is aimed at determining the contribution of autophagy in cavernosal endothelial dysfunction of DED rats and explaining the therapeutic effect of urine-derived stem cells (USCs). Methods. After rat corpus cavernosal vascular endothelial cells (CCECs) were isolated and cultured in vitro, CCECs were treated with advanced glycation end products (AGEs) to mimic the diabetic situation. Autophagy flux, proliferation, and apoptosis of CCECs were determined by mRFP-GFP-LC3 adenovirus infection combined with fluorescence observation and western blot analysis. USCs were isolated from the urine of six healthy male donors, and coculture systems of USCs and CCECs were developed to assess the protective effect of USCs for CCECs in vitro. The contribution of autophagy to the cellular damage in CCECs was evaluated by the autophagic inhibitor, 3-methyladenine (3-MA). Then, DED rats were induced by streptozotocin (50 mg/kg) and screened by apomorphine test (100 μg/kg). In DED rats, USCs or PBS as vehicle was administrated by intracavernous injection (n=15 per group), and another 15 normal rats served as normal controls. Four weeks after injection, erectile function was evaluated by measuring the intracavernosal pressure (ICP) and mean arterial pressure (MAP). Cavernosal endothelial function and autophagic activity were examined by western blot, immunofluorescence, and transmission electron microscopy. Results. In vitro, AGE-treated CCECs displayed fewer LC3 puncta formation and expressed less LC3-II, Beclin1, and PCNA but expressed more p62 and cleaved-caspase3 than controls (p<0.05). Coculture of USCs with CCECs demonstrated that USCs were able to protect CCECs from AGE-induced autophagic dysfunction and cellular damage, which could be abolished by 3-MA (p<0.05). DED rats showed lower ratio of ICP/MAP, reduced expression of endothelial markers, and fewer autophagic vacuoles in the cavernosal endothelium when compared with normal rats (p<0.05). Intracavernous injection of USCs improved erectile function and cavernosal endothelial function of DED rats (p<0.05). Most importantly, our data showed that the repaired erectile function and cavernosal endothelial function were the result of restored autophagic activity of the cavernosal endothelium in DED rats (p<0.05). Conclusions. Impaired autophagy is involved in the cavernosal endothelial dysfunction and erectile dysfunction of DED rats. Intracavernous injection of USCs upregulates autophagic activity in the cavernosal endothelium, contributing to ameliorating cavernosal endothelial dysfunction and finally improving the erectile dysfunction induced by diabetes.