The attapulgite/carbon (ATP/C) nanocomposite was successfully prepared by two ecofriendly raw materials (ATP, which is a hydrated magnesium aluminum silicate widespread in nature, and d‐xylose, which can be obtained from rice hull, wheat straw, etc.) through a facile one‐pot hydrothermal procedure. The synthesis conditions, including reaction time, hydrothermal temperature, and the concentration of d‐xylose, were regulated to investigate the morphology, functional groups, and pore properties of ATP/C. Adsorption experiments demonstrated that the obtained ATP/C materials had great potential in treatment of methylene blue from aqueous solution. A possible formation mechanism of ATP/C nanocomposite was proposed by powder X‐ray diffraction, TG analysis, and N2 adsorption–desorption study, which revealed that carbon successfully anchored onto ATP by the chemical bond of SiOC. © 2014 American Institute of Chemical Engineers Environ Prog, 34: 437–444, 2015