Yellow-headed Blackbirds (Xanthocephalus xanthocephalus) in Manitoba breed in dense colonies in cattail marshes. Their reproductive success is affected mainly by predation. The most important predator on blackbird nests is the Marsh Wren (Cistothorus palustris), which breaks blackbird eggs and kills small nestlings. We examined whether colonial nesting in Yellow-headed Blackbirds may represent an adaptation to reduce Marsh Wren predation. Marsh Wren predation may be reduced by (1) mutual nest defense by adult blackbirds, (2) predator satiation or dilution, or (3) selfish-herd effects. We tested these hypotheses using experimental nests and found that their safety increased with decreasing distance to the nearest blackbird nest and with increasing density of simultaneously active blackbird nests located nearby. Safety also was higher for nests placed inside a blackbird colony rather than outside. These findings support the nest-defense hypothesis. We also found that Marsh Wrens are capable of destroying a whole blackbird colony in a few days, and that colony size is not correlated with nest safety. These results suggest that the satiation or dilution benefits are negligible. Finally, we found that central nests are safer than peripheral nests in a blackbird colony, but not in an artificial colony, providing weak support for the selfish-herd hypothesis. We conclude that nest predation is reduced mainly by mutual nest defense of adult birds and may represent an important selective force favoring colonial nesting in this species.