Microbial fuel cells (MFCs) are devices that exploit microorganisms as biocatalysts to recover energy from organic matter in the form of electricity. One of the goals of MFC research is to develop the technology for cost-effective wastewater treatment. However, before practical MFC applications are implemented it is important to gain fundamental knowledge about long-term system performance, reproducibility, and the formation and maintenance of functionally-stable microbial communities. Here we report findings from a MFC operated for over 300 days using only primary clarifier effluent collected from a municipal wastewater treatment plant as the microbial resource and substrate. The system was operated in a repeat-batch mode, where the reactor solution was replaced once every two weeks with new primary effluent that consisted of different microbial and chemical compositions with every batch exchange. The turbidity of the primary clarifier effluent solution notably decreased, and 97% of biological oxygen demand (BOD) was removed after an 8-13 day residence time for each batch cycle. On average, the limiting current density was 1000 mA/m(2), the maximum power density was 13 mW/m(2), and coulombic efficiency was 25%. Interestingly, the electrochemical performance and BOD removal rates were very reproducible throughout MFC operation regardless of the sample variability associated with each wastewater exchange. While MFC performance was very reproducible, the phylogenetic analyses of anode-associated electricity-generating biofilms showed that the microbial populations temporally fluctuated and maintained a high biodiversity throughout the year-long experiment. These results suggest that MFC communities are both self-selecting and self-optimizing, thereby able to develop and maintain functional stability regardless of fluctuations in carbon source(s) and regular introduction of microbial competitors. These results contribute significantly toward the practical application of MFC systems for long-term wastewater treatment as well as demonstrating MFC technology as a useful device to enrich for functionally stable microbial populations.