In Drosophila, three types of endogenous small RNAs-microRNAs (miRNAs), PIWI-interacting RNAs (piRNAs), and endogenous small-interfering RNAs (endo-siRNAs or esiRNAs)-function as triggers in RNA silencing. Although piRNAs are produced independently of Dicer, miRNA and esiRNA biogenesis pathways require Dicer1 and Dicer2, respectively. Recent studies have shown that among the four isoforms of Loquacious (Loqs), Loqs-PB and Loqs-PD are involved in miRNA and esiRNA processing pathways, respectively. However, how these Loqs isoforms function in their respective small RNA biogenesis pathways remains elusive. Here, we show that Loqs-PD associates specifically with Dicer2 through its C-terminal domain. The Dicer2-Loqs-PD complex contains R2D2, another known Dicer2 partner, and excises both exogenous siRNAs and esiRNAs from their corresponding precursors in vitro. However, Loqs-PD, but not R2D2, enhanced Dicer2 activity. The Dicer2-Loqs-PD complex processes esiRNA precursor hairpins with long stems, which results in the production of AGO2-associated small RNAs. Interestingly, however, small RNAs derived from terminal hairpins of esiRNA precursors are loaded onto AGO1; thus, they are classified as a new subset of miRNAs. These results suggest that the precursor RNA structure determines the biogenesis mechanism of esiRNAs and miRNAs, thereby implicating hairpin structures with long stems as intermediates in the evolution of Drosophila miRNA.