Morphological adaptations of amphisbaenians for a fossorial life constrain their ecological demands in a greater way than for epigeal reptiles. Studies on the diet of amphisbaenians suggest that most species are generalists, although others seem more selective. However, there is no information on the diet preferences of almost any species because most studies did not evaluate the availability of prey in the environment. We analysed the spring diet selection of a population of the amphisbaenian Trogonophis wiegmanni from the Chafarinas Islands, in North Africa. We specifically examined diet estimated from faecal material collected from live amphisbaenians and compared diet with the availability of invertebrates in the soil. Results indicate that the diet of T. wiegmanni amphisbaenians consists of some of the types of invertebrates that are more commonly found under rocks used by amphisbaenians, such as insect larvae, snails, isopods, beetles and ants. This diet could be initially considered generalist, and probably opportunistic. However, the comparison of proportions of prey types in the diet and those available in the habitat revealed that T. wiegmanni does not eat prey at random, but selects some particular prey types (insect larvae and pupae and, surprisingly, snails), while others (ants and isopods) are consumed less than expected by their abundance. We did not found differences between sexes or age classes in diet composition. We discuss how diet preferences could be due to selection of the more profitable or easily captured prey. There are many aspects of the feeding and foraging biology of amphisbaenians that remain unknown and further studies are clearly needed.