The network paradigm has become a popular approach for modeling complex systems, with applications ranging from social sciences to genetics to neuroscience and beyond. Often the individual connections between network nodes are of less interest than network char- acteristics such as its community structure - the tendency in many real-data networks for nodes to be naturally organized in groups with dense connections between nodes in the same (unobserved) group but sparse connections between nodes in different groups. Char- acterizing the structure of networks is of particular interest in the study of brain function, especially in the context of diseases and disorders such as Alzheimer’s disease and attention deficit hyperactivity disorder (ADHD), where disruption of functional brain networks has been observed. The stochastic block model (SBM) is a probabilistic formulation of the community de- tection problem that has been utilized to estimate latent communities in both binary and weighted networks, but as of yet not in brain networks. We build a flexible Bayesian hierar- chical framework for the SBM to capture the community structure in weighted graphs, with a focus on the application in functional brain networks. First, we fit a version of the SBM to Gaussian-weighted networks via an efficient Gibbs sampling algorithm. We compare results from simulated networks to several existing esti- mation methods and then apply our approach to estimate the community structures in the functional resting brain networks of 185 subjects from the ADHD-200 sample. Next, we extend this probabilistic framework and our efficient estimation algorithm to capture the shared latent structure in groups of networks; we perform simulation studies and then apply this extended model to the same sample of brain networks from the ADHD-200 sample. Finally, we adapt this model to allow for more complex latent structures and incorporate a regression component to test for differences in the latent functional brain structure between study groups. After examining the ability of this approach to capture the latent structures in simulated networks, we apply this method once again to the same set of functional brain networks to assess the differences between ADHD subtypes and healthy control subjects in latent functional brain structure.