Antimony (Sb) represents a promising anode for K-ion batteries (KIBs) due to its high theoretical capacity and suitable working voltage. However, the large volume change that occurs in the potassiation/depotassiation process can lead to severe capacity fading. Herein, we report a high-capacity anode material by in situ confining Sb nanoparticles in a three-dimensional carbon framework (3D SbNPs@C) via a template-assisted freeze-drying treatment and subsequent carbothermic reduction. The as-prepared 3D SbNPs@C hybrid material delivers high reversible capacity and good cycling stability when used as the anode for KIBs. Furthermore, cyclic voltammetry and in situ X-ray diffraction analysis were performed to reveal the intrinsic mechanism of a K-Sb alloying reaction. Therefore, this work is of great importance to understand the electrochemical process of the Sb-based alloying reaction and will pave the way for the exploration of high performance KIB anode materials.