Erectile dysfunction (ED) is an adverse side effect of pelvic surgery with no effective treatment. In this study, it is explored whether melatonin could improve the therapeutic effects of small extracellular vesicles (sEVs), derived from mesenchymal stem cells (MSCs), on cavernous nerve injury (CNI) ED, and the underlying mechanisms are investigated. The sEVs from melatonin‐pretreated MSCs (MT‐EVs) and MSCs (NC‐EVs) are isolated and applied to CNI ED. Transplantation of MT‐EVs remarkably increases erectile function and reduces phenotypic modulation in CNI ED rats. The therapeutic effects of MT‐EVs are superior to those of NC‐EVs. Sequencing implies that miR‐10a‐3p is enriched in MT‐EVs, and directly targets the protein kinase inhibitor α (PKIA). After the suppression of miR‐10a‐3p, the therapeutic actions of MT‐EVs are abolished, but are rescued by PKIA. Similarly, RhoA/ROCK is inhibited by MT‐EVs, but this action is reversed by suppressing miR‐10a‐3p, accompanied by corresponding changes in PKIA. In conclusion, transplantation of MT‐EVs could significantly alleviate CNI ED. MT‐EVs may relieve the phenotypic modulation of the corpora cavernosum smooth muscle cells via the miR‐10a‐3p/PKIA/RhoA/ROCK signaling axis. These nanovesicles should be potential therapeutic vectors or bioactive materials for CNI ED.