Three-dimensional (3D) nanofabrication techniques are of paramount importance in nanoscience and nanotechnology because they are prerequisites to realizing complex, compact, and functional 3D nanodevices. Although several 3D nanofabrication methods have been proposed and developed in recent years, it is still a formidable challenge to achieve a balance among resolution, accuracy, simplicity, and adaptability. Here, we propose a 3D nanofabrication method based on electron-beam lithography using ice resists (iEBL) and fabricate 3D nanostructures by stacking layered structures and those with dose-modulated exposure, respectively. The entire process of 3D nanofabrication is realized in one vacuum system by skipping the spin-coating and developing steps required for commonly used resists. This needs far fewer processing steps and is contamination-free compared with conventional methods. With in situ alignment and correction in the iEBL process, a pattern resolution of 20 nm and an alignment error below 100 nm can be steadily achieved. This 3D nanofabrication technique using ice thus shows great potential in the fabrication of complicated 3D nanodevices.