Two new Costa Rican species of Megaselia Rondani (Megaselia mithridatesi new species and Megaselia toxicobibitor new species) that are attracted to polydesmidan (Diplopoda) defensive compound secretions are described. The strikingly colored Megaselia schildi Borgmeier appears to be closely related to these species, and new records of its association with polydesmidan millipedes are given. These three species represent the only examples of Phoridae outside of the millipedeparasitoid genus Myriophora Brown that are attracted to millipede defensive compounds. The natural history and behavior of these species are discussed.