1. Search processes play an important role in physical, chemical and biological systems. In animal foraging, the search strategy predators should use to search optimally for prey is an enduring question. Some models demonstrate that when prey is sparsely distributed, an optimal search pattern is a specialised random walk known as a Lévy flight, whereas when prey is abundant, simple Brownian motion is sufficiently efficient. These predictions form part of what has been termed the Lévy flight foraging hypothesis (LFF) which states that as Lévy flights optimise random searches, movements approximated by optimal Lévy flights may have naturally evolved in organisms to enhance encounters with targets (e.g. prey) when knowledge of their locations is incomplete. 2. Whether free-ranging predators exhibit the movement patterns predicted in the LFF hypothesis in response to known prey types and distributions, however, has not been determined. We tested this using vertical and horizontal movement data from electronic tagging of an apex predator, the great white shark Carcharodon carcharias, across widely differing habitats reflecting different prey types. 3. Individual white sharks exhibited movement patterns that predicted well the prey types expected under the LFF hypothesis. Shark movements were best approximated by Brownian motion when hunting near abundant, predictable sources of prey (e.g. seal colonies, fish aggregations), whereas movements approximating truncated Lévy flights were present when searching for sparsely distributed or potentially difficult-to-detect prey in oceanic or shelf environments, respectively. 4. That movement patterns approximated by truncated Lévy flights and Brownian behaviour were present in the predicted prey fields indicates search strategies adopted by white sharks appear to be the most efficient ones for encountering prey in the habitats where such patterns are observed. This suggests that C. carcharias appears capable of exhibiting search patterns that are approximated as optimal in response to encountered changes in prey type and abundance, and across diverse marine habitats, from the surf zone to the deep ocean. 5. Our results provide some support for the LFF hypothesis. However, it is possible that the observed Lévy patterns of white sharks may not arise from an adaptive behaviour but could be an emergent property arising from simple, straight-line movements between complex (e.g. fractal) distributions of prey. Experimental studies are needed in vertebrates to test for the presence of Lévy behaviour patterns in the absence of complex prey distributions. © 2011 The Authors. Journal of Animal Ecology © 2011 British Ecological Society.