Abstract We present a dynamic optimal control model to show how territorial male great tits ( Parus major L.) should combine territorial vigilance with foraging. In the model, territory owners allocate time either to feeding in patches or travelling between them. Travelling is compatible with territorial vigilance, while feeding is not. Owners are assumed to adjust their patch residence and travel times in order to minimize the costs accruing from intruders on their territories, while at the same time reducing their hunger. The relation between patch residence and travel time matches that of Charnov's (1976) marginal value theorem while hunger is high, but as hunger is reduced the dynamic model predicts shorter patch residence times for any observed travel time. We present supporting evidence from an experimental test with captive male great tits.