X-ray free-electron lasers enable the investigation of the structure and dynamics of diverse systems, including atoms, molecules, nanocrystals and single bioparticles, under extreme conditions. Many imaging applications that target biological systems and complex materials use hard X-ray pulses with extremely high peak intensities (exceeding 1020 watts per square centimetre). However, fundamental investigations have focused mainly on the individual response of atoms and small molecules using soft X-rays with much lower intensities. Studies with intense X-ray pulses have shown that irradiated atoms reach a very high degree of ionization, owing to multiphoton absorption, which in a heteronuclear molecular system occurs predominantly locally on a heavy atom (provided that the absorption cross-section of the heavy atom is considerably larger than those of its neighbours) and is followed by efficient redistribution of the induced charge. In serial femtosecond crystallography of biological objects-an application of X-ray free-electron lasers that greatly enhances our ability to determine protein structure-the ionization of heavy atoms increases the local radiation damage that is seen in the diffraction patterns of these objects and has been suggested as a way of phasing the diffraction data. On the basis of experiments using either soft or less-intense hard X-rays, it is thought that the induced charge and associated radiation damage of atoms in polyatomic molecules can be inferred from the charge that is induced in an isolated atom under otherwise comparable irradiation conditions. Here we show that the femtosecond response of small polyatomic molecules that contain one heavy atom to ultra-intense (with intensities approaching 1020 watts per square centimetre), hard (with photon energies of 8.3 kiloelectronvolts) X-ray pulses is qualitatively different: our experimental and modelling results establish that, under these conditions, the ionization of a molecule is considerably enhanced compared to that of an individual heavy atom with the same absorption cross-section. This enhancement is driven by ultrafast charge transfer within the molecule, which refills the core holes that are created in the heavy atom, providing further targets for inner-shell ionization and resulting in the emission of more than 50 electrons during the X-ray pulse. Our results demonstrate that efficient modelling of X-ray-driven processes in complex systems at ultrahigh intensities is feasible.