Spent Ni–Cd batteries bring a severe environmental problem that needs to be solved urgently. A novel continuous flow two-step leaching system based on bioleaching was introduced to dissolve heavy metals in batteries. It consists of an acidifying reactor which was used to culture indigenous thiobacilli and a leaching reactor which was used to leach metals from spent batteries. The indigenous acidophilic thiobacilli in sewage sludge was used as the microorganisms and the sludge itself as culture medium. Bioleaching tests at different hydraulic retention time (HRT) and process load in the leaching reactor were performed. The results showed that the longer the HRT (1, 3, 6, 9 and 15 days) was, the more time required to achieve the complete leaching of Ni, Cd and Co. The maximum dissolution of cadmium and cobalt was achieved at higher pH values (3.0–4.5) while the leaching of nickel hydroxide and nickel in metallic form (Ni 0) were obtained separately in different acidity (pH 2.5–3.5). It cost about 25, 30 and more than 40 days to remove all of the three heavy metals with the process load of two, four and eight Ni–Cd batteries under the conditions that the ingoing bio-sulphuric acid was 1 L d −1 and HRT was 3 days.