Rare earth elements (lanthanides) are critical materials for many applications, particularly those involved in new energy. Extracting these elements economically from low-concentration sources may be challenging. This study investigates the interaction of Ce and Gd with microalgae that have been triggered to form phosphate-rich granules. Lanthanides usually occur in nature as phosphates, and therefore, we hypothesized that phosphate accumulation in microalgae may facilitate lanthanide sequestration. Synchrotron-based scanning transmission X-ray microspectroscopy (STXM) was used to map the distribution of Gd, Ce, and P in and around cells of Chlamydomonas reinhardtii. STXM provided X-ray absorption (XAS) spectra at the Gd M 4,5 -edge, the Ce M 4,5edge, and the P K-edge, supported by bulk X-ray absorption spectroscopy at another beamline, and elemental maps from scanning electron microscopy with energy-dispersive spectroscopy (SEM/EDS). Gd was associated with P in polyphosphate granules within C. reinhardtii and with P outside the cells. Ce was associated with P outside the microalgal cells but not with the P granules inside the cells. Gd and Ce were found to react with phosphate to form a distinct compound apparent in X-ray absorption near edge spectroscopy (XANES) of bulk samples. However, this compound is not found in the P granules that are coincident with Gd inside the alga. These differences in uptake by the microalga between Ce and Gd may suggest a selective extraction technique and could be generalized to other rare earth elements that are otherwise hard to separate.