The present study investigates foraging and territorial behaviour of the strawberry poison frog (Oophaga pumilio) in dependence of the presence of formicine and myrmicine ants, which constitute the main food source of the frogs. Species of the formicine ant genera Brachymyrmex and Paratrechina contain highly toxic alkaloids (pumiliotoxins), which the frogs incorporate and accumulate in their skin what may serve for predator deterrence. Twelve male frogs of two populations (primary and secondary forest) in Hitoy Cerere, Costa Rica, were observed each for a full day. Calling time, feeding attempts and time spent inside and outside the core area of their territories were recorded. Furthermore, twelve males of both populations were observed during the main foraging time to determine, whether the frogs search for prey in specific patches of their territories. The ants inside the core areas of twenty four frog territories were collected and classified to genus. Ants of the genera Brachymyrmex and Paratrechina were classified to species or morphospecies, respectively. The presence of formicine and myrmicine ants in territorial areas was compared to non-territorial sites. We found that formicine ants (Brachymyrmex and Paratrechina) were more present inside the territorial core areas than outside. The higher presence of these ants in the core areas was associated with longer foraging times. We verified that toxic alkaloids of the pumiliotoxin group are present in the dendrobatid frogs of Hitoy Cerere. The results of this study suggest that toxic diet may be linked to territoriality in this frog species.