TiO2 nanofibers were prepared by improved electrospinning technique and subsequent thermal treatment. The as-prepared TiO2 nanofibers possess anatase-rutile mischcrystal structure. Sulfur was mixed with the TiO2 nanofibers to form S–TiO2 composite by a melt diffusion process. The S–TiO2 composite displays more excellent discharge capacity retention of 58% after 50 cycles compared to pure S, and the discharge capacity is 530mAhg−1 after 50 cycles, which is ascribed to the adsorption of lithium polysulfide by TiO2.