Parasitoidism of ants by flies is known only for Phoridae and Tachinidae. We report the first record of a hoverfly (Syrphidae, Microdontinae, Hypselosyrphus) acting as a true primary parasitoid of ants. Previously, larvae of Microdontinae were known only as obligate predators of ant brood. This is also the first host record for any Hypselosyrphus species, the first reliable record of an association between a syrphid fly and a ponerine ant, and the first record of a dipteran parasitoid developing upon the immature stages of ants. We reared adults of Hypselosyrphus trigonus from cocoons of the arboreal ponerine ant, Pachycondyla villosa, nesting in Aechmea bracteata bromeliads in southern Quintana Roo, Mexico, and we succeeded in determining various aspects of the parasitoid's life history. The findings obtained in the present study provide novel insights into the evolutionary transformation and diversification of the feeding habits of microdontine syrphid larvae, from an obligatory, specific predatory association with the ant brood, to parasitoidism of ant prepupae. We also highlight the need for more detailed studies of the interactions of arboreal ants and their parasites. We conclude with an overview of the evolutionary transitions and diversification of larval feeding habits that have taken place within the family Syrphidae. © 2013 The Linnean Society of London, Biological Journal of the Linnean Society, 2014, 111, 462–472.