A magnetically induced self-assembled graphene nanoribbons (GNRs) method is reported to synthesize MFe2O4/GNRs (M = Co,Ni). It is found that MFe2O4compounds not only locate on the surface of GNRs but anchor on the interlayers of GNRs in the diameter of less than 5 nm as well. The in situ growth of MFe2O4and magnetic aggregation at the joints of GNRs act as crosslinking agents to solder GNRs to build a nest structure. Additionally, combining GNRs with MFe2O4helps to improve the magnetism of the MFe2O4. As an anode material for Li+ion batteries, MFe2O4/GNRs can provide high reversible capacity and cyclic stability (1432 mAh g−1for CoFe2O4/GNRs and 1058 mAh g−1for NiFe2O4at 0.1 A g−1over 80 cycles).