The Einstein-de Haas effect was originally observed in a landmark experiment1 demonstrating that the angular momentum associated with aligned electron spins in a ferromagnet can be converted to mechanical angular momentum by reversing the direction of magnetization using an external magnetic field. A related problem concerns the timescale of this angular momentum transfer. Experiments have established that intense photoexcitation in several metallic ferromagnets leads to a drop in magnetization on a timescale shorter than 100 femtoseconds-a phenomenon called ultrafast demagnetization2-4. Although the microscopic mechanism for this process has been hotly debated, the key question of where the angular momentum goes on these femtosecond timescales remains unanswered. Here we use femtosecond time-resolved X-ray diffraction to show that most of the angular momentum lost from the spin system upon laser-induced demagnetization of ferromagnetic iron is transferred to the lattice on sub-picosecond timescales, launching a transverse strain wave that propagates from the surface into the bulk. By fitting a simple model of the X-ray data to simulations and optical data, we estimate that the angular momentum transfer occurs on a timescale of 200 femtoseconds and corresponds to 80 per cent of the angular momentum that is lost from the spin system. Our results show that interaction with the lattice has an essential role in the process of ultrafast demagnetization in this system.