We measure for the first time the overall extent within which stars in distant galaxies were born. At all cosmic epochs, star formation in massive galaxies preferentially takes place in their central region, indicating that we are witnessing the final assembly of their stellar bulges. Few galaxies have a more compact star-forming extent, and all of them produce stars at a much higher rate than the average. This suggests a different mechanism triggering their star formation activities, such as the merger of two gas-rich disks.