Impregnation of a mesoporous xerogel or of MCM-41 with an organic solution of the heterometallic cluster [NEt4][Co3Ru(CO)12], followed by thermal treatment under an inert atmosphere, leads to highly dispersed magnetic nanoparticles under milder conditions than when conventional metal salts are used as precursors.