The interplay among charge, spin and lattice degrees of freedom in solids gives rise to intriguing macroscopic quantum phenomena such as colossal magnetoresistance, multiferroicity and high-temperature superconductivity. Strong coupling or competition between various orders in these systems presents the key to manipulate their functional properties by means of external perturbations such as electric and magnetic fields or pressure. Ultrashort and intense optical pulses have emerged as an interesting tool to investigate elementary dynamics and control material properties by melting an existing order. Here, we employ few-cycle multi-terahertz pulses to resonantly probe the evolution of the spin-density-wave (SDW) gap of the pnictide compound BaFe(2)As(2) following excitation with a femtosecond optical pulse. When starting in the low-temperature ground state, optical excitation results in a melting of the SDW order, followed by ultrafast recovery. In contrast, the SDW gap is induced when we excite the normal state above the transition temperature. Very surprisingly, the transient ordering quasi-adiabatically follows a coherent lattice oscillation at a frequency as high as 5.5 THz. Our results attest to a pronounced spin-phonon coupling in pnictides that supports rapid development of a macroscopic order on small vibrational displacement even without breaking the symmetry of the crystal.