Biochar is an attractive low-cost sorbent for removal of heavy metals such as cadmium (Cd) from solution. This study presents modification of sugarcane leaf biochars with phosphoric acid (H3PO4) and magnesium oxide (MgO) and the influence of Mg:P atomic ratio (varied from 0 to 2) on the Cd2+ adsorption performance was evaluated. Compared to unmodified biochar (BC), pre-pyrolysis modification with H3PO4 alone (P-BC) greatly increased the surface area from 296 to 505 m2/g but its Cd2+ adsorptivity decreased by 5-folds due to high acidity. Incorporation of alkaline MgO increased the Cd2+ adsorption and pH, despite a reduction in surface area, confirming that Mg played a predominant role in Cd2+ removal. When Mg:P > 1 (1.5MgP-BC and 2MgP-BC), more than 99% of the Cd2+ was removed, but the solutions were alkaline with pH > 8. Adsorbent 1MgP-BC presented an overall good performance with a maximum Cd2+ adsorption capacity of 36.4 mg/g (compared to 12.8 mg/g for BC) and neutral pH. The adsorption kinetics of Cd2+ onto both BC and 1MgP-BC were best described by the Elovich and pseudo-second order models, suggesting chemisorption as primary adsorption mechanism. Adsorption isotherms followed the Langmuir (for 1MgP-BC) and Freundlich isotherm models (for BC). Characterization of the post-adsorption biochars with XRD, FTIR, XPS and SEM–EDX confirmed that Cd2+ adsorption onto BC was governed by precipitation of CdCO3 and interaction with specific surface sites, whereas for 1MgP-BC the Cd2+ was primarily adsorbed onto Mg phosphates on the biochar surface and precipitated as Cd3(PO4)2.