Coastal development has generated multiple stressors in marine and estuarine ecosystems, including habitat degradation and pollutant exposure, but the effects of these stressors on the ecology of fishes remain poorly understood. We studied the separate and combined effects of an acute 4 h sublethal exposure of the pyrethroid pesticide esfenvalerate and structural habitat complexity on behavior and predation risk of larval topsmelt (Atherinops affinis). Larvae were exposed to four nominal esfenvalerate concentrations (control, 0.12, 0.59, 1.18 μg/L), before placement into 12 L mesocosms with a three-spine stickleback (Gasterosteus aculeatus) predator. Five treatments of artificial eelgrass included a (1) uniform and (2) patchy distribution of eelgrass at a low density (500 shoots per m(2)), a (3) uniform and (4) patchy distribution of eelgrass at a high density (1,000 shoots per m(2)), and (5) the absence of eelgrass. The capture success of predators and aggregative behavior of prey were observed in each mesocosm for 10 min of each trial, and mortality of prey was recorded after 60 min. Exposure to esfenvalerate increased the proportion of larvae with swimming abnormalities. Surprisingly, prey mortality did not increase linearly with pesticide exposure but increased with habitat structure (density of eelgrass), which may have been a consequence of compensating predator behavior. The degree of prey aggregation decreased with both habitat structure and pesticide exposure, suggesting that anti-predator behaviors by prey may have been hampered by the interactive effects of both of these factors.