Focused short-wavelength free-electron laser (FEL) pulses interacting with gas phase samples can induce by inner-shell ionization a short-lived population inversion, followed by coherent collective emission of directed, short, and strong radiation bursts. We extend our studies into the warm-dense matter (WDM) regime by investigating the nanoplasmas produced in an ensemble of nanometer-sized clusters by FEL irradiation. Here, additional pathways can also lead to strong, laserlike emission: Electron-ion collisions can yield a long-lived population inversion, and subsequent amplified spontaneous emission. We observe amplified spontaneous emission (ASE) in the extreme ultraviolet in xenon clusters excited by soft x-ray FEL pulses, we diagnose the generated nanoplasmas by fluorescence spectroscopy, and we study under various cluster and FEL parameters the directed ASE from the Xe 2+ 65 nm line. We show its exponential increase as a function of FEL irradiation power, and an accompanying collisional broadening of the emission spectra. These findings are corroborated by extensive numerical simulations based on theory, combining detailed hydrodynamic and kinetic simulations with time-dependent calculations of radiation transport, amplification, and collective emission in the WDM nanoplasma. Our theoretical findings underline that population inversion is due to electron-ion collisions and that the observed decoherence processes can be empirically characterized by a phenomenological decoherence time in the range of 100-200 fs.