Here, we report mesoporous TiO2@N-doped carbon composite nanospheres synthesized via a double-surfactant-assisted assembly sol–gel process followed by sequential carbonization of surfactants under a N2 atmosphere. The resulting TiO2@N-doped C composite nanospheres are composed of uniformly distributed TiO2 nanocrystals with a diameter of ∼8 nm coated by a N-doped carbon layer that was formed by surfactants. Moreover, a large number of connected mesopores were observed in the nanospheres after high-temperature carbonization treatment. The synthesized nanospheres possess a large specific surface area (∼120 m2 g−1) and a large pore size (4–40 nm), with a well-defined spherical structure and a diameter in the nanoscale range. As an anode material for lithium-ion batteries (LIB), the mesoporous composite nanospheres delivered a reversible capacity of ∼117 mA h g−1 after 2000 cycles at a current rate as high as 10 C, as well as superior rate capability. The N-doped carbon layers greatly improved the overall electrical conductivity of the mesoporous TiO2 nanospheres. This study provides a remarkable synthetic route for the preparation of mesoporous TiO2-based N-doped carbon composite materials as high-performance anode materials in LIBs.