Using ab initio spin-density-functional calculations, we investigate the electronic and magnetic structures of a C-60 fullerene during a structural transition to a nanotube segment by a series of Stone-Wales transformations. We find that partly opened intermediate cage structures may acquire a magnetic moment of several Bohr magnetons. Our results offer a possible explanation for the ferromagnetic behavior observed in polymerized C-60 following exposure to high temperatures and pressures, and suggest the use of carbon nanostructures for magnetic measurements.