Thiol-modified rice straw biochar (RS) was prepared by an esterification reaction with β-mercaptoethanol and used for the remediation of Cd and Pb polluted soils. Modified biochar was characterized through elemental analysis, BET analysis, FE-SEM, FT-IR and XPS. These analytical results revealed that thiol groups were successfully grafted onto the surface of the biochar and were involved in metal ion complexation. Batch sorption experiments indicated that Cd2+ and Pb2+ sorption onto RS described well by a pseudo second order kinetic model and a Langmuir isotherm. The maximum adsorption capacities for Cd2+ and Pb2+, in the single-metal systems, were 45.1 and 61.4 mg g-1, respectively. In the binary-metal systems, RS selectively adsorbed Cd2+ over Pb2+. Cd2+ and Pb2+ were removed mainly through surface complexation. In the soil incubation experiments (28 days), RS reduced the available Cd by 34.8-39.2%; while, RS reduced the available Pb by 8.6%-11.1%. This research demonstrates RS as a potentially effective amendment for the remediation of heavy metal polluted soils.