In recent years, memristors have successfully demonstrated their significant potential in artificial neural networks (ANNs) and neuromorphic computing. Nonetheless, ANNs constructed by crossbar arrays suffer from cross-talk issues and low integration densities. Here, we propose an eight-layer three-dimensional (3D) vertical crossbar memristor with an ultrahigh rectify ratio (RR > 107) and an ultrahigh nonlinearity (>105) to overcome these limitations, which enables it to reach a >1 Tb array size without reading failure. Furthermore, the proposed 3D RRAM shows advanced endurance (>1010 cycles), retention (>104 s), and uniformity. In addition, several synaptic functions observed in the human brain were mimicked. On the basis of the advanced performance, we constructed a novel 3D ANN, whose learning efficiency and recognition accuracy were enhanced significantly compared with those of conventional single-layer ANNs. These findings hold promise for the development of highly efficient, precise, integrated, and stable VLSI neuromorphic computing systems.