In this article, we have synthesized Co2+-doped BiOBrxCl1-x hierarchical nanostructured microspheres, featuring different degrees of Co2+ doping, displaying excellent photocatalytic performance. X-ray diffraction and Raman spectroscopy indicated that the Co2+ ions were successfully doped into the BiOBrxCl1-x nanocrystals. The photodegradation rate of rhodamine B mediated by a doped BiOBrxCl1-x was 150 % greater than that of the non-doped BiOBr. We ascribe the improved photocatalytic capability of the Co2+-doped BiOBrxCl1-x to a combination of its superior degree of light absorption, more efficient carrier separation, and faster interfacial charge migration. The major active species involved in the photodegradation of RhB also has been investigated. Moreover, the doped BiOBrxCl1-x possessed excellent cellular biocompatibility and displayed remarkable performance in the photocatalytic bacterial inactivation.