From late April, males and females move from deeper waters to shallow areas. There, each male defends a territory where he builds a nest on the bottom. He starts by digging a small pit. He then fills it with plant material (often filamentous algae), sand, and various debris which he glues together with spiggin, a proteinaceous substance secreted from the kidneys (the word spiggin comes from "spigg", the Swedish name for the three-spined stickleback). He then creates a tunnel through the more or less spherical nest by swimming vigorously through it. Nest building typically takes 5–6 hours though it may also be spread out over several days. After this, the male courts gravid females that pass by with a zigzag dance. He approaches a female by swimming very short distances left and right, and then swims back to the nest in the same way. If the female follows, the male often pokes his head inside the nest, and may swim through the tunnel. The female then swims through the tunnel as well, where she deposits 40–300 eggs. The male follows to fertilize the eggs. The female is then chased away by the male. For the duration of the eggs' development, the male will chase away other males and nongravid females. He may, however, court other gravid females (more than one batch of eggs can be deposited in the same nest).