Molybdenum disulfide (MoS2) has been a promising anode material in lithium-ion batteries (LIBs) because of its high theoretical capacity and large interlayer spacing. However, its intrinsic poor electrical conductivity and large volume changes during the lithiation/delithiation reactions limit its practical application. An efficient synthesis strategy was developed to prepare the MoS2nanocrystals well-anchored into the N-doped nanoporous carbon framework to deal with these challenges by a confined reaction space in an acrylonitrile-based porous polymer during the carbonization process. The prepared hybrid material comprises small 1T/2H-MoS2nanoparticles surrounded by a nanoporous carbon matrix. In addition to the highly crystalline nature of the synthesized MoS2, the low ID/IGof the Raman spectrum demonstrated the development of graphitic domains in the carbon support during low-temperature pyrolysis (700 °C). This novel three-dimensional (3D) hierarchical composite shows superior advantages, such as decreased diffusion lengths of lithium ions, preventing the agglomeration of MoS2nanocrystals, and maintaining the whole structural stability. The prepared C/MoS2hybrid demonstrated fast rate performance and satisfactory cycling stability as an anode material for LIBs.