Germline stem cells (GSCs) in Drosophila are descendants of primordial germ cells (PGCs) specified during embryogenesis. The precise timing of GSC establishment in the testis has not been determined, nor is it known whether mechanisms that control GSC maintenance in the adult are involved in GSC establishment. Here, we determine that PGCs in the developing male gonad first become GSCs at the embryo to larval transition. This coincides with formation of the embryonic hub; the critical signaling center that regulates adult GSC behavior within the stem cell microenvironment (niche). We find that the Jak-STAT signaling pathway is activated in a subset of PGCs that associate with the newly-formed embryonic hub. These PGCs express GSC markers and function like GSCs, while PGCs that do not associate with the hub begin to differentiate. In the absence of Jak-STAT activation, PGCs adjacent to the hub fail to exhibit the characteristics of GSCs, while ectopic activation of the Jak-STAT pathway prevents differentiation. These findings show that stem cell formation is closely linked to development of the stem cell niche, and suggest that Jak-STAT signaling is required for initial establishment of the GSC population in developing testes.