Four organometallic compounds were synthesized for solid-state pyrolysis (SSP) to research the structure-property relationship between the precursors and the as-generated magnetic ceramic nanocomposites (MCNs). In which, the only saturated carbon atom in MC was replaced by N or O or S atom, to produce MN, MO and MS, respectively. It was found that, the crystal phase of the cobalt catalyst could be regulated by introducing different heteroatoms during the pyrolysis: fcc-Co for MC/MN, while fcc/hcp-Co hybrid for MO/MS. Metal cobalt with different crystal phases has their special catalytic and magnetic properties. Thus, MCNs with totally different morphology, composition and properties could be prepared by just changing one heteroatom in the precursors upon SSP. Uniform nanotubes were generated from pyrolysis of MC/MN, while nanospheres were generated from MO/MS. The obtained MCNs all show excellent magnetic properties with Ms ranged from 47.6 to 54.2 emu g-1. Analyzing carefully, due to the magnetic difference between fcc-Co and hcp-Co, the Ms of the MCNs obtained from MO/MS were slightly lower than those of MC/MN, but, their Mr and Hc were 2 to 5 times higher than the latter.