Although both food availability and predation risk have been hypothesized to affect dolphin habitat use and group size, no study has measured both factors concurrently to determine their relative influences. From 1997 to 1999, we investigated the effect of food availability and tiger shark (Galeocerdo cuvier) predation risk on bottlenose dolphin (Tursiops aduncus) habitat use and group size in Shark Bay, Western Australia. Food availability was measured by fish trapping, while predation risk was assessed by shark catch rates, acoustic tracks, and Crittercam deployments. Dolphin habitat use was determined using belt transects. The biomass of dolphin prey did not vary seasonally and was significantly greater in shallow habitats than in deeper ones. Tiger sharks were virtually absent during cold months of 1997 and 1998, abundant in warm months of all years, and found at an intermediate density during cold months of 1999. When present, shark density was highest in shallow habitats. Decreased echolocation efficiency in very shallow water and poor visual detection of tiger sharks (camouflaged over seagrass) probably further enhance the riskiness of such habitats, and the relative riskiness of shallow habitats is supported by the observation that dolphins select deep waters in which to rest. The observed dolphin group sizes were consistent with a food–safety trade-off. Groups were larger in more dangerous shallow habitats and larger during resting than during foraging. Foraging dolphins matched the distribution of their food when sharks were absent. However, during warm months, the distribution of foraging dolphins significantly deviated from that of their food, with fewer dolphins foraging in the productive (but dangerous) shallow habitats than expected on the basis of food alone. When shark density was intermediate, habitat use by foraging dolphins was more similar to the high-shark-density seasons than periods of low shark density. These results suggest that foraging dolphin distributions reflect a trade-off between predation risk and food availability. Because the distribution and abundance of tiger sharks are influenced by species other than dolphins, the distribution of the tiger sharks' primary prey may indirectly influence dolphin habitat use, suggesting that it is important to consider the community context in studies of habitat use.