In this study, we report the first preparation of phase-pure Co9S8 yolk–shell microspheres in a facile two-step process and their improved electrochemical properties. Yolk–shell Co3O4 precursor microspheres are initially obtained by spray pyrolysis and are subsequently transformed into Co9S8 yolk–shell microspheres by simple sulfidation in the presence of thiourea as a sulfur source at 350 °C under a reducing atmosphere. For comparison, filled Co9S8 microspheres were also prepared using the same procedure but in the absence of sucrose during the spray pyrolysis. The prepared yolk–shell Co9S8 microspheres exhibited a Brunauer–Emmett–Teller (BET) specific surface area of 18 m2 g−1 with a mean pore size of 16 nm. The yolk–shell Co9S8 microspheres have initial discharge and charge capacities of 1008 and 767 mA h g−1 at a current density of 1000 mA g−1, respectively, while the filled Co9S8 microspheres have initial discharge and charge capacities of 838 and 638 mA h g−1, respectively. After 100 cycles, the discharge capacities of the yolk–shell and filled microspheres are 634 and 434 mA h g−1, respectively, and the corresponding capacity retentions after the first cycle are 82 % and 66 %.