The phantom midge, Chaoborus, is a dipteran, the larvae of which occur in many freshwater habitats and are known to be vulnerable to predation by fish. The hypothesis was tested that ovipositing imagines of Chaoborus use chemical cues to detect predatory fish and avoid depositing eggs into waterbodies containing fish kairomones. The experimental setup consisted of cages with two small water‐filled plastic containers, in which Chaoborus imagines could oviposit. One container was connected to a flow‐through system holding fish kairomones, while the other container (the control) was connected to a flow‐through system without fish kairomones. Three different Chaoborus species were tested: two pond‐dwelling species, Chaoborus crystallinus and C. obscuripes, which do not coexist with fish, and a lake‐dwelling species, C. flavicans, which does coexist with fish. The imagines of the two pond‐dwelling species showed an ovipositing preference for fish‐free water. No significant difference in ovipositing preference was found for the lake‐dwelling species (C. flavicans). The present experiment suggests that in addition to direct predatory effects, adult oviposition behavior may contribute to the lack of local coexistence between fish and pond‐dwelling Chaoborus.