The recent discovery of superconductivity in oxypnictides with a critical transition temperature (TC) higher than the McMillan limit of 39 K (the theoretical maximum predicted by Bardeen–Cooper–Schrieffer theory) has generated great excitement1, 2, 3, 4, 5. Theoretical calculations indicate that the electron–phonon interaction is not strong enough to give rise to such high transition temperatures6, but strong ferromagnetic/antiferromagnetic fluctuations have been proposed to be responsible7, 8, 9. Superconductivity and magnetism in pnictide superconductors, however, show a strong sensitivity to the crystal lattice, suggesting the possibility of unconventional electron–phonon coupling. Here we report the effect of oxygen and iron isotope substitution on TC and the spin-density wave (SDW) transition temperature (TSDW) in the SmFeAsO1 - xFx and Ba1 - xKxFe2As2 systems. The oxygen isotope effect on TC and TSDW is very small, while the iron isotope exponent C = -dlnTC/dlnM is about 0.35 (0.5 corresponds to the full isotope effect). Surprisingly, the iron isotope exchange shows the same effect on TSDW as TC. This indicates that electron–phonon interaction plays some role in the superconducting mechanism, but a simple electron–phonon coupling mechanism seems unlikely because a strong magnon–phonon coupling is included.