Synthesis of ordered mesoporous carbons containing Co, Ni, and Fe nanoparticles within the mesostructure was performed through carbonization of poly( furfuryl alcohol) in the presence of metal nitrate inside SBA-15 mesoporous silica templates. The use of the transition metal nitrates, instead of Al catalyst, led also to the formation of highly ordered mesoporous carbons having the same structure as CMK-3. The 2-dimensionally hexagonal p6mm structure was constructed from a regular array of uniform nanopores ( typically 4 - 5 nm in diameter) and carbon frameworks ( typically 4 nm in thickness). The state of the materials during the carbonization process was characterized by X-ray diffraction, nitrogen physisorption, transmission electron microscopy, and X-ray absorption fine structure spectroscopy of the metal elements. The results showed that metal nanoparticles, 25 - 40 nm in diameter, were embedded inside the mesoporous carbon networks. The nanoparticles were formed due to spontaneous reduction of the metal elements during carbonization, following the initial action as a catalyst for the polymerization of furfuryl alcohol. The magnetic hysteresis loop for the cobalt-containing carbon showed soft ferromagnetic behaviour at room temperature. In particular, the cobalt nanoparticles could be protected against acidic erosion by repeating impregnation and polymerization of furfuryl alcohol once more before its carbonization treatment. The process is proposed as a method for preparation of magnetically separable mesoporous carbons, for application as an adsorbent or catalyst support.