A new type of hyperbranched polysilazane containing iron (PSZI) compound was synthesized by the polycondensation of silazane lithium salts with FeCl 3 , and the structure of the PSZIs was investigated by IR, NMR and elemental analyses. The PSZIs were pyrolyzed under nitrogen, argon or NH 3 , and magnetic ceramics could be obtained. The ceramic yields of the PSZIs were higher than those of their corresponding silazanes, and the PSZIs or silazanes with reactive groups containing Si-H, -CH=CH 2 or higher branched structures had higher yields. The magnetism of the ceramics could be controlled by a pyrolytic atmosphere and temperature: the saturation magnetization M s ranged from 20 to 100 emu g À1 and coercivity H c ranged from 463 to 50 Oe. The transformation of the magnetic loop of the PSZIs pyrolyzed at different temperatures under NH 3 was quite different from those under nitrogen. It was shown by X-ray diffraction measurements that the magnetic crystalline form could exist as Fe 4 N, Fe(0) or Fe 3 N depending on temperature under NH 3 , but under a nitrogen atmosphere Fe(0) was nearly the only magnetic crystalline form from 600 to 1100°C. By dipping or spin-coating of the PSZI solution, then through pyrolysis under nitrogen, argon or NH 3 , thin uniform magnetic ceramic films could be fabricated on the substrates.