Spatial and temporal variation in the distribution and abundance of site-attached fish species inhabiting small, isolated patches of coral reef has been attributed to variability in larval recruitment. However, the relative importance of settlement and postsettlement processes in determining the structure of fish communities in general, i.e., including non-site-attached species inhabiting large sections of contiguous reef, remains to be determined. Here, we examine the degree of spatial and temporal variation in community structure and population density of fish inhabiting sections of coral reef varying in size and connectivity. To investigate spatial variability in fish community structure and population density, we surveyed 36 sites on contiguous reef and 39 patch-reef sites varying in size and isolation from neighboring patches. Ordination and regression analyses indicated that the structure of fish assemblages inhabiting contiguous reef varied predictably along habitat gradients. In contrast, intrinsic habitat characteristics, such as the shelter availability and the composition of the substratum, were apparently unrelated to the structure of fish assemblages on patch reefs. For sites on contiguous reef, multiple regression models explained a significant proportion of spatial variation in the population density of 10 site-attached and vagile species (including 90% of variation in the density of Pomacentrus moluccensis, a site-attached damselfish). For patch-reef sites, models of spatial variation in population density were significant for six species, five of which were not site attached. The overall pattern across most species was that patch-reef models were characterized by a reduced r2 relative to corresponding models of contiguous-reef populations, but the reduction was substantially less for vagile species than for site-attached species. Ordination analysis of temporal variability in community structure over two years suggested that none of the fish communities at the sites examined was in a consistent state of community succession. For most sites, community structure varied randomly over time, although at some sites, the structure of resident fish communities tended towards a stable position in multivariate community space. Across all sites, temporal change in community structure was significantly higher during periods of recruitment than at other times of the year, although there was little evidence to suggest that recruitment was the sole source of temporal variation. At most sites, the structure of fish assemblages fluctuated considerably during nonrecruitment periods. Patterns of temporal variation in the population density of four site-attached species indicated that population increases corresponding with pulses of recruitment were modified by postsettlement processes. For site-attached and moderately vagile species, overall temporal variability in assemblage structure increased significantly as sites became smaller and more isolated. Temporal variability in assemblages of highly vagile species was unrelated to survey area and connectivity. Overall, the results of the analyses of spatial and temporal variability in fish community structure suggest that species' vagility and reef connectivity strongly influence the relative importance of recruitment and postrecruitment processes in determining local population density. Individuals of highly vagile species are able to move among isolated patches in response to habitat preferences or resource availability. Conversely, the continuous shelter provided by contiguous reef may allow sedentary species to migrate to more favorable areas. We suggest that for many fish species, including vagile species on patchy reef and site-attached species on contiguous reef, patterns in distribution and abundance established at recruitment are modified by postsettlement migration, which enhances the relationship between population density and habitat structure. Thus, while recruitment patterns may explain much of the spatial and temporal variation in populations of site-attached fish on small, isolated patch reefs, this result cannot necessarily be extrapolated to fish communities inhabiting large sections of contiguous reef.