OpenStax Anatomy and Physiology
Sexual differentiation does not begin until the fetal period, during weeks 9–12. Embryonic males and females, though genetically distinguishable, are morphologically identical. Bipotential gonads, or gonads that can develop into male or female sexual organs, are connected to a central cavity called the cloaca via Müllerian ducts and Wolffian ducts. (The cloaca is an extension of the primitive gut.) Several events lead to sexual differentiation during this period.
During male fetal development, the bipotential gonads become the testes and associated epididymis. The Müllerian ducts degenerate. The Wolffian ducts become the vas deferens, and the cloaca becomes the urethra and rectum.
During female fetal development, the bipotential gonads develop into ovaries. The Wolffian ducts degenerate. The Müllerian ducts become the uterine tubes and uterus, and the cloaca divides and develops into a vagina, a urethra, and a rectum.
Betts, J. G., Young, K. A., Wise, J. A., Johnson, E., Poe, B., Kruse, D. H., … DeSaix, P. (n.d.). Anatomy and Physiology. Houston, Texas: OpenStax. Access for free at: https://openstax.org/details/books/anatomy-and-physiology