Choice of breeding habitat can have a major impact on fitness. Sensitivity of habitat choice to environmental cues predicting reproductive success, such as density of harmful enemy species, should be favored by natural selection. Yet, experimental tests of this idea are in short supply. Brown-headed cowbirds Molothrus ater commonly reduce reproductive success of a wide diversity of birds by parasitizing their nests. We used song playbacks to simulate high cowbird density and tested whether cowbird hosts avoid such areas in habitat selection. Host species that made settlement decisions during manipulations were significantly less abundant in the cowbird treatment as a group. In contrast, hosts that settled before manipulations started and non-host species did not respond to treatments. These results suggest that hosts of cowbirds can use vocal cues to assess parasitism risk among potential habitat patches and avoid high risk habitats. This can affect community structure by affecting habitat choices of species with differential vulnerability.