Death came suddenly for the young fish darting through a lake roughly 50 million years ago. But their quick demise from an unknown cause preserved them in stone, and now they are helping scientists to understand early social behaviour.

Nobuaki Mizumoto at Arizona State University in Tempe and his colleagues examined a stone slab from the western United States that includes the fossils of 257 now-extinct fish (Erismatopterus levatus) bunched together in a dense swarm. The researchers analysed each fish’s orientation and position and then modelled what each animal’s position would have been just after the moment preserved on the slab.

The results show that the ancient fish followed two rules used by their modern counterparts. An individual was repelled by its closest companions — to avoid collisions — and attracted to those farther away, which encouraged clumping. Like a modern-day school, the fossilized grouping had an elongated shape that might have helped to ward off predators.