Following the discovery of long-range antiferromagnetic order in the parent compounds of high-transition-temperature (high-Tc) copper oxides1, 2, there have been efforts to understand the role of magnetism in the superconductivity that occurs when mobile 'electrons' or 'holes' are doped into the antiferromagnetic parent compounds. Superconductivity in the newly discovered rare-earth iron-based oxide systems ROFeAs (R, rare-earth metal) also arises from either electron3, 4, 5, 6, 7 or hole8 doping of their non-superconducting parent compounds. The parent material LaOFeAs is metallic but shows anomalies near 150 K in both resistivity and d.c. magnetic susceptibility3. Although optical conductivity and theoretical calculations suggest that LaOFeAs exhibits a spin-density-wave (SDW) instability that is suppressed by doping with electrons to induce superconductivity9, there has been no direct evidence of SDW order. Here we report neutron-scattering experiments that demonstrate that LaOFeAs undergoes an abrupt structural distortion below 155 K, changing the symmetry from tetragonal (space group P4/nmm) to monoclinic (space group P112/n) at low temperatures, and then, at 137 K, develops long-range SDW-type antiferromagnetic order with a small moment but simple magnetic structure9. Doping the system with fluorine suppresses both the magnetic order and the structural distortion in favour of superconductivity. Therefore, like high-Tc copper oxides, the superconducting regime in these iron-based materials occurs in close proximity to a long-range-ordered antiferromagnetic ground state.