Both natural selection and sexual selection may act on nest-building. We tested experimentally how different regimes of egg-predation and male-male competition influence nest-building before mating, using the marine fish sand goby, Pomatoschistus minutus. Males with sneaker males present built the smallest nest-openings, smaller than males held alone or with Pomatoschistus microps males (which may predate eggs and compete over nest-sites but not compete over fertilizations). Males with visual access to other nest-building males tended also to build smaller openings than males held alone or with P. microps. Males with egg-predators present built nests with openings not differing significantly from any other treatment. Our results indicate that the small nest-openings found in the sneaker male treatment are sexually selected through protection against sneaking or by female choice. Across treatments, time span before a male started to build his nest also explained variation in nest-opening width; males starting late built larger nest-openings.