Purpose Biochars may enhance the retention capacity of metals in soils, especially in highly weathered tropical soil whose low cation exchange capacity renders heavy metals mobile, and thus be able to leach from soils. We evaluated the effect of sugarcane-straw-derived biochar on sorption and desorption of Cd(II) and Zn(II) in two tropical soils in particular to distinguish primary and secondary mechanisms of metal retention. Material and methods To test the efficiency of biochar to retain heavy metals, sugarcane-straw-derived biochar was mixed with a clayey Oxisol and an Entisol both from the state of Sao Paulo, Brazil, in batch testing to obtain sorptiondesorption isotherms of Cd(II) and Zn(II) and measure the release/displacement of cations (Ca 2+ and Mg 2+ ) or precipitation with phosphate during the sorption process. Results and discussion Biochar increased the sorption (including adsorption and precipitation) of both metals in both soils but that most sorption reactions were reversible under buffer acidic conditions, due to dissolution of precipitates in low pH values (<4.9). Exchange of Cd or Zn with Ca and Mg from the biochar was found to play a minor role on the retention mechanism, whereas surface precipitation (mainly in the Entisol) of the metals (e.g. with phosphate) was likely to be the main sorption mechanism. Conclusions Application of sugarcane-straw-derived biochar to heavy-metal-contaminated tropical soils seems justified because of its sorptive capacity for Cd and Zn. However, binding reactions on surfaces were reversible, mainly for Cd(II), resulting in the likelihood that repeat applications of biochar would be required to maintain reduced soil solution concentrations of Cd and Zn over time, thus avoiding phytotoxicity and associated environmental risks.