23 1. Stream ecosystems are spatially heterogeneous environments due to the habitat diversity 24 that define different microhabitat patches within a single area. Despite the influence of 25 habitat heterogeneity on the biodiversity of insect community, little is known about how 26 habitat heterogeneity governs species coexistence and community assembly. Here, we 27 address the question if habitat heterogeneity may drive changes in community composition28 of the stonefly (Plecoptera, Insecta) community in different sampling locations, by 29 assessing the relative role of the habitats that explain beta biodiversity patterns (spatial 30 structure) and evolutionary processes (phylogenetic signal) in structuring communities.31 2. We sampled across seven habitats types among 20 sampling sites in Alpine rivers, and we 32 used mitochondrial DNA, cox1, and nuclear DNA, ITS, genetic markers on 21 stoneflies 33 morpho-species to estimate putative DNA-species by General Mixed Yule Coalescent 34 model (GMYC). With the use of putative DNA-species, we first analyzed the patterns of 35 variation of DNA-species richness, composition, and diversity of stonefly community 36 assessing their habitat correlates. Then, we assessed through a phylogenetic clustered 37 pattern if DNA-species with similar physiological requirements co-occur due to 38 environmental filtering.39 3. Based on 52 putative DNA-species, we found that corridors contributed to DNA-species 40 richness where the meandering corridor section displayed the highest contribution. While, 41 habitats contributed to DNA-species diversity, where glide, riffle, and pool influenced the 42 spatial structure of the stonefly community possible owed to the high species turnover 43 observed.44 4. Among the habitats, pool showed a significant phylogenetic clustering, suggesting 45 evolutionary adaptation and strong habitat filtering. This pattern of community phylogenetic 46 structure could have resulted from the long-term stability of the habitat and physiological 47 requirements of the species that cohabitate.48 5. Our study shows the importance of different habitats on the spatial and phylogenetic 49 structure of stonefly community assemblies and sheds light on the habitat-specific diversity 50 that may help improve conservation practices. 51 52 53 KEYWORDS 54 DNA-species, habitats, spatial structure, phylogenetic structure, Plecoptera 55 56 93 species based on variation in DNA sequences (DNA taxonomy; Vogler & Monaghan, 2006) 94 using Generalized Mixed Yule Coalescent model (GMYC; Pons et al., 2006) is one of the most 95 common methods employed for recognizing putative DNA-species. Briefly, GMYC identify the 96 transition rate between inter and intra-species branching events on a time-calibrated ultrametric 97 tree (distances from the root of every branch is equal), using molecular markers, as