Congenital anomalies of external genitalia affect approximately 1 in 125 live male births. Development of the genital tubercle, the precursor of the penis and clitoris, is regulated by the urethral plate epithelium, an endodermal signaling center. Signaling activity of the urethral plate is mediated by Sonic hedgehog (SHH), which coordinates outgrowth and patterning of the genital tubercle by controlling cell cycle kinetics and expression of downstream genes. The mechanisms that govern Shh transcription in urethral plate cells are largely unknown. Here we show that deletion of Foxa1 and Foxa2 results in persistent cloaca, an incomplete separation of urinary, genital, and anorectal tracts, and severe hypospadias, a failure of urethral tubulogenesis. Loss of Foxa2 and only one copy of Foxa1 results in urethral fistula, an additional opening of the penile urethra. Foxa1/a2 participate in an autoregulatory feedback loop with Shh, in which FOXA1 and FOXA2 positively regulate transcription of Shh in the urethra, and SHH feeds back to negatively regulate Foxa1 and Foxa2 expression. These findings reveal novel roles for Foxa genes in development of the urethral tube and in division of the embryonic cloaca.