Soil-based wastewater treatment systems, or leachfields, rely on microbial processes for improving the quality of wastewater before it reaches the groundwater. These processes are affected by physicochemical system properties, such as O2 availability, and disturbances, such as the presence of antimicrobial compounds in wastewater. We examined the microbial community structure of leachfield mesocosms containing native soil and receiving domestic wastewater under intermittently-aerated (AIR) and unaerated (LEACH) conditions before and after dosing with tetracycline (TET). Community structure was assessed using phospholipid fatty acid analysis (PLFA), analysis of dominant phylotypes using polymerase chain reaction-denaturing gradient gel electrophoresis (PCR–DGGE), and cloning and sequencing of 16S rRNA genes. Prior to dosing, the same PLFA biomarkers were found in soil from AIR and LEACH treatments, although AIR soil had a larger active microbial population and higher concentrations for nine of 32 PLFA markers found. AIR soil also had a larger number of dominant phylotypes, most of them unique to this treatment. Dosing of mesocosms with TET had a more marked effect on AIR than LEACH soil, reducing the size of the microbial population and the number and concentration of PLFA markers. Dominant phylotypes decreased by ~15% in response to TET in both treatments, although the AIR treatment retained a higher number of phylotypes than the LEACH treatment. Fewer than 10% of clones were common to both OPEN ACCESS Water 2013, 5 506 AIR and LEACH soil, and fewer than 25% of the clones from either treatment were homologous with isolates of known genus and species. These included human pathogens, as well as bacteria involved in biogeochemical transformations of C, N, S and metals, and biodegradation of various organic contaminants. Our results show that intermittent aeration has a marked effect on the size and structure of the microbial community that develops in a native leachfield soil. In addition, there is a differential response of the microbial communities of AIR and LEACH soil to tetracycline addition which may be linked to changes in function.