Development of the reproductive system
The development of the reproductive system is the part of embryonic growth that results in the sex organs and contributes to sexual differentiation. Due to its large overlap with development of the urinary system, the two systems are typically described together as the urogenital or genitourinary system. The reproductive organs develop from the intermediate mesoderm and are preceded by more primitive structures that are superseded before birth. These embryonic structures are the mesonephric ducts (also known as Wolffian ducts) and the paramesonephric ducts, (also known as Müllerian ducts). The mesonephric duct gives rise to the male seminal vesicles, epididymises and vas deferens. The paramesonephric duct gives rise to the female fallopian tubes, uterus, cervix, and upper part of the vagina. Mesonephric ducts

The mesonephric duct originates from a part of the pronephric duct. Origin
In the outer part of the intermediate mesoderm, immediately under the ectoderm, in the region from the fifth cervical segment to the third thoracic segment, a series of short evaginations from each segment grows dorsally and extends caudally, fusing successively from before backward to form the pronephric duct. This continues to grow caudally until it opens into the ventral part of the cloaca; beyond the pronephros it is termed the mesonephric duct. Thus, the mesonephric duct remains after the atrophy of the pronephros duct. Development in male
In the male the duct persists, and forms the tube of the epididymis, the vas deferens and the ejaculatory duct, while the seminal vesicle arises during the third month as a lateral diverticulum from its hinder end. A large part of the head end of the mesonephros atrophies and disappears; of the remainder the anterior tubules form the efferent ducts of the testicle; while the posterior tubules are represented by the ductuli aberrantes, and by the paradidymis, which is sometimes found in front of the spermatic cord above the head of the epididymis. Atrophy in female
In the female the mesonephric bodies and ducts atrophy. The nonfunctional remains of the mesonephric tubules are represented by the epoophoron, and the paroöphoron, two small collections of rudimentary blind tubules which are situated in the mesosalpinx. Remnants

The lower part of the mesonephric duct disappears, while the upper part persists as the longitudinal duct of the epoöphoron, called Gartner's duct. There are also developments of other tissues from the mesonephric duct that persist, e.g. the development of the suspensory ligament of the ovary. Paramesonephric ducts

Shortly after the formation of the mesonephric ducts a second pair of ducts is developed; these are the paramesonephric ducts. Each arises on the lateral aspect of the corresponding mesonephric duct as a tubular invagination of the cells lining the abdominal cavity. The orifice of the invagination remains open, and undergoes enlargement and modification to form the distal tubal opening (abdominal ostium) of the fallopian tube. The ducts pass backward lateral to the mesonephric ducts, but toward the posterior end of the embryo they cross to the medial side of these ducts, and thus come to lie side by side between and behind the latter—the four ducts forming what is termed the common genital cord, to distinguish it from the genital cords of the germinal epithelium seen later in this article. The mesonephric ducts end in an epithelial elevation, the sinus tubercle, on the ventral part of the cloaca between the orifices of the mesonephric ducts. At a later stage the sinus tubercle  opens in the middle, connecting the paramesonephric ducts with the cloaca. Atrophy in males
In the male the paramesonephric ducts atrophy (but traces of their anterior ends are represented by the appendix of testis of the male), while their terminal fused portions form the prostatic utricle in the floor of the prostatic urethra. This is due to the production of Anti-Müllerian hormone by the Sertoli cells of the testes. Development in females

In the female the paramesonephric ducts persist and undergo further development. The portions which lie in the genital cord fuse to form the uterus  and vagina. This fusion of the paramesonephric ducts begins in the third month, and the septum formed by their fused medial walls disappears from below upward. The parts outside this cord remain separate, and each forms the corresponding Fallopian tube. The ostium of the fallopian tube remains from the anterior extremity of the original tubular invagination from the abdominal cavity. About the fifth month a ring-like constriction marks the position of the cervix of the uterus, and after the sixth month the walls of the uterus begin to thicken. For a time the vagina is represented by a solid rod of epithelial cells. A ring-like outgrowth of this epithelium occurs at the lower end of the uterus and marks the future vaginal fornix. At about the fifth or sixth month the lumen of the vagina is produced by the breaking down of the central cells of the epithelium. The hymen represents the remains of the sinus tubercle . Gonads

The gonads are the precursors of the testes in males and ovaries in females. They initially develop from the mesothelial layer of the peritoneum. Ovaries
The ovary is differentiated into a central part, the medulla of ovary, covered by a surface layer, the germinal epithelium. The immature ova originate from cells from the dorsal endoderm of the yolk sac. Once they have reached the gonadal ridge they are called oogonia. Development proceeds and the oogonia become fully surrounded by a layer of connective tissue cells (pre-granulosa cells). In this way, the rudiments of the ovarian follicles are formed. The embryological origin of granulosa cells, on the other hand, remains controversial. Just as in the male, there is a gubernaculum in the female, which pulls it downward, albeit not as much as in males. The gubernaculum later becomes the proper ovarian ligament and the round ligament of the uterus. Testes
The periphery of the testes are converted into the tunica albuginea. Cords of the central mass run together and form a network which becomes the rete testis, and another network, which develops the seminiferous tubules. Via the rete testis, the seminiferous tubules become connected with outgrowths from the mesonephros, which form the efferent ducts of the testis. In short, the descent of the testes consists of the opening of a connection from the testis to its final location at the anterior abdominal wall, followed by the development of the gubernaculum, which subsequently pulls and translocates the testis down into the developing scrotum. Ultimately, the passageway closes behind the testis. A failure in this process can cause indirect inguinal hernia or an infantile hydrocoele. Division of cloaca

After the separation of the rectum from the dorsal part of the cloaca, the ventral part becomes the primary urogenital sinus. The urogenital sinus, in turn, divides into the superficial definitive urogenital sinus and the deeper anterior vesico-urethral portion. Definitive urogenital sinus
The definitive urogenital sinus consists of a caudal cephalic portion and an intermediate narrow channel, the pelvic portion. Vesico-urethral portion
The vesico-urethral portion is the deepest portion, continuous with the allantois. It absorbs the ends of the mesonephric ducts and the associated ends of the renal diverticula, and these give rise to the trigone of urinary bladder and part of the prostatic urethra. The remainder of the vesico-urethral portion forms the body of the bladder and part of the prostatic urethra; its apex is prolonged to the umbilicus as a narrow canal, the urachus, which later is obliterated and becomes the median umbilical ligament of the adult. Prostate
The prostate originally consists of two separate portions, each of which arises as a series of diverticular buds from the epithelial lining of the urogenital sinus and vesico-urethral part of the cloaca, between the third and fourth months. These buds become tubular, and form the glandular substance of the two lobes, which ultimately meet and fuse behind the urethra and also extend on to its ventral aspect. The median lobe of the prostate is formed as an extension of the lateral lobes between the common ejaculatory ducts and the bladder. Skene's glands in the female urethra are regarded as the homologues of the prostatic glands. The bulbourethral glands in the male, and Bartholin's gland in the female, also arise as diverticula from the epithelial lining of the urogenital sinus. External genitalia

Until about the ninth week of gestational age the external genitalia of males and females look the same, and follow a common development. This includes the development of a genital tubercle and a membrane dorsally to it, covering the developing urogenital opening, and the development of the labioscrotal fold. The urogenital folds become the penoscrotal raphe in the male and the labia minora in the female. Even after differentiation can be seen between the sexes, some stages are common, e.g. the disappearing of the membrane. On the other hand, sex-dependent development include further protrusion of the genital tubercle in the male to form the glans and shaft of the penis and in the female, the glans and body of the clitoris. The labioscrotal swelling evolves into the scrotum in males, and into the labia majora in females. Common development

Before differentiation

Urogenital membrane
There is initially a cloacal membrane, composed of ectoderm and endoderm, reaching from the umbilical cord to the tail, separating the cloaca from the exterior. After the separation of the rectum from the dorsal part of the cloaca, the ventral part of the cloacal membrane becomes the urogenital membrane. Genital tubercle
Mesoderm extends to the midventral line for some distance behind the umbilical cord, and forms the lower part of the abdominal wall; it ends below in a prominent swelling, the cloacal tubercle, which after the separation of the rectum becomes the genital tubercle. Dorsally to this tubercle the sides are not really fused. Rather, the urogenital part of the cloacal membrane separates the ingrowing sheets of mesoderm. Phallus
The genital tubercle develops into the primordial phallus, the first rudiment of the penis or clitoris. The terminal part of the phallus, representing the future glans becomes solid. The remainder of the phallus, which remains hollow, is converted into a longitudinal groove by the absorption of the urogenital membrane. The term genital tubercle still remains but only refers to the future glans

Urogenital opening
In both sexes the phallic portion of the urogenital sinus extends on to the under surface of the cloacal tubercle as far forward as the apex. At the apex the walls of the phallic portion come together and fuse, obliterating the urogenital opening. Instead, a solid plate, the urethral plate, is formed. The remainder of the phallic portion is for a time tubular, and then, by the absorption of the urogenital membrane, it establishes a communication with the exterior. This opening is for a while the primitive urogenital opening, and it extends forward to the corona glandis. After differentiation

The following developments occur in both males and females, although a difference in the development between the sexes already can be seen:

The corpus cavernosum penis, and the corpus cavernosum of clitoris, and the corpus spongiosum penis arise from the mesodermal tissue in the phallus; they are at first dense structures, but later vascular spaces appear in them, and they gradually become cavernous. The prepuce in both sexes is formed by the growth of a solid plate of ectoderm into the superficial part of the phallus; on coronal section this plate presents the shape of a horseshoe. By the breaking down of its more centrally situated cells the plate is split into two lamellæ. Thus, a cutaneous fold, the prepuce, is liberated and forms a hood over the glans. Female
In the female, a deep groove forms around the phallus. The sides of it grow dorsalward as the labioscrotal folds, which ultimately form the labia majora in females. The labia minora, in contrast, arise by the continued growth of the lips of the groove on the under surface of the phallus; the remainder of the phallus forms the clitoral glans. Male
The labioscrotal folds extend around between the pelvic portion and the anus, and form a scrotal area. During the changes associated with the descent of the testes this scrotal area is drawn out to form the scrotal sacs. The penis is developed from the phallus. As in the female, the urogenital membrane undergoes absorption, forming a channel on the under surface of the phallus; this channel extends only as far forward as the corona glandis. Urogenital opening
Later, this opening, which is located on the dorsal side of the penis, closes from behind forward. Meanwhile, the urethral plate of the glans breaks down centrally to form a median groove continuous with the primitive ostium. This groove also closes from behind forward, leaving only a small pipe running in the middle of the penis. Thus, the urogenital opening is shifted forward to the end of the glans. Diagram of internal differentiation

A.—Diagram of the primitive urogenital organs in the embryo previous to sexual distinction. 3. Ureter. 4. Urinary bladder. 5. Urachus. cl. Cloaca. cp. Elevation which becomes clitoris or penis. i. Lower part of the intestine. ls. Fold of integument from which the labia majora or scrotum are formed. m, m. Right and left Müllerian ducts uniting together and running with the Wolffian ducts in gc, the genital cord. ot. The genital ridge from which either the ovary or testis is formed. ug. Sinus urogenitalis. W. Left Wolffian body. w, w. Right and left Wolffian ducts. B.—Diagram of the female type of sexual organs. C. Greater vestibular gland, and immediately above it the urethra. cc. Corpus cavernosum clitoridis. dG. Remains of the left Wolffian duct, such as give rise to the duct of Gärtner, represented by dotted lines; that of the right side is marked w.
 f. The abdominal opening of the left uterine tube. g. Round ligament, corresponding to gubernaculum. h. Situation of the hymen. i. Lower part of the intestine. l. Labium majus. n. Labium minus. o. The left ovary. po. Epoophoron. sc. Corpus cavernosum urethrae. u. Uterus. The uterine tube of the right side is marked m.
 v. Vulva. va. Vagina. W. Scattered remains of Wolffian tubes near it (paroöphoron of Waldeyer). C.—Diagram of the male type of sexual organs. C. Bulbo-urethral gland of one side. cp. Corpora cavernosa penis cut short. e. Caput epididymis. g. The gubernaculum. i. Lower part of the intestine. m. Müllerian duct, the upper part of which remains as the hydatid of Morgagni; the lower part, represented by a dotted line descending to the prostatic utricle, constitutes the occasionally existing cornu and tube of the uterus masculinus. pr. The prostate. s. Scrotum. sp. Corpus cavernosum urethrae. t. Testis in the place of its original formation. t’, together with the dotted lines above, indicates the direction in which the testis and epididymis descend from the abdomen into the scrotum. vd. Ductus deferens. vh. Ductus aberrans. vs. The vesicula seminalis. W. Scattered remains of the Wolffian body, constituting the organ of Giraldès, or the paradidymis of Waldeyer. References

In-line

General
Henry Gray (1821–1865). Anatomy of the Human Body. 1918. External links
Animations of gonadal sex, duct differentiation, and external genital development at AboutKidsHealth.ca

Embryology of urogenital system
Andrology
Gynaecology