The penis, the organ that bears reproductive and psychological importance, is susceptible to birth defects such as hypospadias or incomplete closure of urethra along the penis shaft. We discover that proper urethral closure in mouse embryos requires a unique mesenchymal cell population originated from outside of the penis. These "extragenital" cells, marked by a lineage marker Nr5a1, migrate from the inguinal region into the embryonic penis and facilitate urethra closure by interacting with adjacent periurethral cells via the epidermal growth factor pathway. Ablation of Nr5a1+ cells leads to severe hypospadias and alters cell differentiation in the penis. This discovery highlights the indispensable role of Nr5a1+ extragenital cells in urethra closure, shedding light on the biology of penis formation and potential implications for human hypospadias.