A magnetic nanocomposite, using a Nopal cactus-derived biopolymer in combination with NH4OH-modified cobalt superparamagnetic (CoFe2O4) nanoparticles, was developed as a green flocculant system for recovery of microalgae from aqueous solutions. The obtained magnetic nanomaterials were subsequently dispersed in the biopolymer matrix with the support of ultrasonic waves. The effects of various factors on pectin extraction, fabrication of nanocomposites, and the flocculation process of microalgae were also studied. The characteristics of the obtained materials (pectin, modified magnetic nanoparticles, and nanocomposites) were evaluated via X-ray powder diffraction, scanning electron microscopy, transmission electron microscopy, vibrating sample magnetometry, thermogravimetric-differential scanning calorimetry, Fourier transform infrared spectroscopy, and zeta potential analysis. The optimal conditions for pectin extraction from Nopal cactus, as well as the fabrication of magnetic nanoparticles, modified magnetic nanoparticles, and nanocomposite were reported. The characteristic data of the fabricated materials showed heat resistance and abundant surface functional groups with high magnetization. The observed flocculation was attributed to the aggregation of unstable and small particles through surface charge neutralization, electrostatic patching, and/or bridging after addition of flocculants. The results showed that the nanocomposites could be a potential green flocculant for recovering microalgae with low cost and high efficiency.