The cell wall (CW) is critical for the accumulation of heavy metals in metal-tolerant plants. Polysaccharides, the main component of the CW, contribute significantly to the immobilization of heavy metals. However, the mechanisms of rare earth elements (REEs) adsorption and detoxification by polysaccharides in the cell walls ofPhytolacca americanaL. (P. americana) remain unclear. In this work, we explored the binding sites of REEs and the modifications to polysaccharides in the cell walls of roots and leaves inP. americana, in order to elucidate the adsorption and fixation mechanism of REEs by the cell wall. Our findings indicated that up to 40.7% and 48.1% of cell-wall-bound REEs were present in the root and leaf pectin, respectively. The removal of pectin led to a 39.8% and 23.6% decrease in the maximum adsorption of REEs in the CW, suggesting that pectin was the main binding site for REEs in the cell walls ofP. americana. Hydroxyl (-OH) and carboxyl (-COOH) groups in the cell wall interacted mainly with REEs ions under stress conditions, which played a key role in REEs binding. An obvious REEs fractionation was found during the various fractions of the CW, and all fractions of the root cell wall were enriched with HREEs, whereas all fractions of the leaf cell wall were enriched with LREEs. Moreover,P. americanamodulated cell wall composition in reaction to REEs stress. In conclusion, cell wall pectin is the main binding site of REEs, and the functional groups on the cell wall play a significant role in the binding of REEs. At the same time, plants can control the selective adsorption and fixation of REEs by adjusting the composition of cell walls. This study offers valuable insights into the mechanisms of REEs adsorption and fixation in cell walls ofP. americana, contributing to a theoretical basis for the bioremediation of REEs pollution.