Over the last decades, aerial insectivorous birds have been declining in both North America and Europe. Those declines have been hypothetically attributed to a decrease in prey availability caused by agricultural intensification, but empirical evidence remains scarce. Here, we quantify the effect of landscape composition on the abundance and diversity of potential prey of Tree Swallows (Tachycineta bicolor (Vieillot, 1808)) and on nestling diet in southern Quebec, Canada. We collected food boluses from nestlings and compared their composition with spatiotemporally corresponding samples from traps on farms distributed along a gradient of agricultural intensification. The diet of nestlings was mostly composed of Diptera, both in biomass and abundance, but by mid-June, these decreased with increasing proportions of intensively cultivated crops within 500 m of the nests. Trap catches for Diptera and all arthropods combined followed the same trends. Yet, the associations between Diptera subgroups (Nematocera, non-schizophoran Brachycera, Schizophora (Calyptratae), and Schizophora (Acalyptratae)) and landscape composition differed between traps and boluses, suggesting that prey selection was altered by agricultural intensification. Our results suggest that agriculture can alter the availability of preferred prey for aerial insectivores, and further studies should evaluate the impact of prey availability to explain the decline of aerial insectivores.