THE distribution of neutral hydrogen absorption lines in quasars indicates that the intergalactic medium is fully formed even at the highest redshifts1,2: highly ionized gas fills most of space, but there are many denser, lower-entropy condensations with a higher fraction of neutral gas, and a few very dense, optically thick clouds thought to be associated with the progenitors of modern galaxies. This early ionization requires there to have been some form of energy injection (heat or light) at redshift z > 5, but its precise origin is unknown. (Possible sources of ionizing energy range from decaying massive neutrinos3–5 to faint but numerous active galaxies.) I argue here that any fairly uniform source of ionizing photons can be the cause of an instability in the pre-galactic medium on scales larger than a photon path length. Underdense regions receive more ionizing energy per atom and reach higher temperature and entropy, driving the density down still further. Fluctuations created by this instability can lead to the formation of structures resembling protogalaxies and intergalactic clouds, obviating the need for gas clouds or density perturbations of earlier cosmological provenance, as is usually assumed in theories of galaxy and structure formation.