ABSTRACT During the epoch of reionization (EoR), the 21-cm signal allows direct observation of the neutral hydrogen (H i) in the intergalactic medium (IGM). In the post-reionization era, this signal instead probes H i in galaxies, which traces the dark matter density distribution. With new numerical simulations, we investigated the end stages of reionization to elucidate the transition of our Universe into the post-reionization era. Our models are consistent with the latest high-redshift measurements, including ultraviolet (UV) luminosity functions up to redshift $\simeq$8. Notably, these models consistently reproduced the evolution of the UV photon background, which is constrained from Lyman-$\alpha$ absorption spectra. We studied the dependence of this background on the nature of photon sinks in the IGM, requiring mean free path of UV photons to be $\sim$10 comoving-megaparsecs (cMpc) during the EoR that increases gradually with time during late stages ($z\lesssim 6$). Our models revealed that the reionization of the IGM transitioned from an inside-out to an outside-in process when the Universe is less than 0.01 per cent neutral. During this epoch, the 21-cm signal also shifted from probing predominantly the H i in the IGM to that in galaxies. Furthermore, we identified a statistically significant number of large neutral islands (with sizes up to 40 cMpc) persisting until very late stages ($5 \lesssim z \lesssim 6$) that can imprint features in Lyman-$\alpha$ absorption spectra and also produce a knee-like feature in the 21-cm power spectrum.