Astronomers have caught multiple massive galaxies in the act of merging about 4 billion years ago. This discovery, made possible by combining the power of the best ground- and space-based telescopes, uniquely supports the favoured theory of how galaxies form. How do galaxies form? The most widely accepted answer to this fundamental question is the model of 'hierarchical formation', a step-wise process in which small galaxies merge to build larger ones. One can think of the galaxies forming in a similar way to how streams merge to form rivers, and how these rivers, in turn, merge to form an even larger river. This theoretical model predicts that massive galaxies grow through many merging events in their lifetime. But when did their cosmological growth spurts finish? When did the most massive galaxies get most of their mass? To answer these questions, astronomers study massive galaxies in clusters, the cosmological equivalent of cities filled with galaxies.