Optimal foraging theories predict that air-breathing, diving foragers should maximize time spent at feeding depths, and minimize time spent travelling between surface and depth (transits). The second part of this hypothesis was tested in free-ranging king penguins Aptenodytes patagonicus using measurements of vertical speed, swimming speed, body angle and flipper stroke frequency during transits in relation to an index of foraging success (number of wiggles), during the bottom and the ascent phases of the dive. We found that, except for flipper stroke frequency, all measured variables increased with diving depth and foraging activity. The change in vertical speed was driven mainly by a change in body angle and a slight change in swimming speed. These results suggest a shortening of transit duration in response to increased foraging activity. Whereas the time spent commuting between the surface and foraging depths was reduced when foraging activity was high, vertical speed was only at its maximum over a small part of both ascent and descent phases of the dive. Within the first 10 m of descent, vertical speed increased with maximum dive depth and an index of foraging activity, suggesting that penguins anticipated their diving depth and foraging activity. Our results show that foraging king penguins adjust their diving behaviour in response to both diving depth and foraging activity. Further studies should consider ecological, physiological or mechanical constraints as factors that may limit foraging optimization.