Femtosecond excitation of ${\text{SrRuO}}_{3}$ nanolayers in a ${\text{SrRuO}}_{3}/{\text{SrTiO}}_{3}$ superlattice quenches their ferromagnetism, resulting in magnetostriction. The buildup of mechanical stress is observed in real time by mapping lattice motions via ultrafast x-ray diffraction. A rise time of 500 fs is found for a wide range of excitation wavelengths. In the ferromagnetic phase, phonon-mediated $({\ensuremath{\sigma}}_{\text{ph}})$ and magnetostrictive stress $({\ensuremath{\sigma}}_{M})$ components display similar strengths but opposite signs. The amplitude of ${\ensuremath{\sigma}}_{M}$ follows the temperature dependent magnetization ${M}^{2}(T)$ whereas the strength of ${\ensuremath{\sigma}}_{\text{ph}}$ is determined by the amount of deposited energy.