Many high-redshift galaxies have peculiar morphologies and photometric properties [1-5]. It is not clear whether these peculiarities originate in galaxy-galaxy interactions (or mergers) or are intrinsic to the galaxies, a natural consequence of the star formation process in primeval systems. Here I report the results of numerical simulations of protogalaxy evolution, which show that the gas-rich disk of a young galaxy becomes gravitationally unstable and fragments into massive clumps of sub-galactic size. Most of the stars are formed in these discrete clumps, thereby providing a natural explanation for the peculiar morphology of high-redshift galaxies. The dynamical evolution of these young systems is dominated by the clumps and ultimately leads to structures resembling present-day galaxies, with a spheroidal bulge and an exponential disk. I interpret the differences between the Hubble types of galaxies as resulting from different timescales of disk formation. Finally, the model provides a causal link between the emergence of quasar activity and the dynamical evolution of the host galaxy.