Preclinical experimental study. To develop an intraoperative ultrasound-assisted imaging device, which could be placed at the surgical site through an endoscopic working channel and which could help surgeon recognition of different tissue types during endoscopic spinal surgery (ESS). ESS remains a challenging task for spinal surgeons. Great proficiency and experience are needed to perform procedures such as intervertebral discectomy and neural decompression within a narrow channel. The limited surgical view poses a risk of damaging important structures, such as nerve roots. We constructed a spinal endoscopic ultrasound system, using a 4-mm custom ultrasound probe, which can be easily inserted through the ESS working channel, allowing up to 10 mm depth detection. This system was applied to ovine lumbar spine samples to obtain ultrasound images. Subsequently, we proposed a two-stage classification algorithm, based on a pretrained DenseNet architecture for automated tissue recognition. The recognition algorithm was evaluated using accuracy and consistency. The probe can be easily used in the ESS working channel and produce clear and characteristic ultrasound images. We collected 367 images for training and testing of the recognition algorithm, including images of the spinal cord, nucleus pulposus, adipose tissue, bone, annulus fibrosus and nerve roots. The algorithm achieved over 90% accuracy in recognizing all types of tissues with a Kappa value of 0.875. The recognition times were under 0.1 s using the current configuration. Our system was able to be used in existing ESS working channels and clearly identified at-risk spinal structures in vitro. The pretrained algorithms could identify six intraspinal tissue types accurately and quickly. The concept and innovative application of intraoperative ultrasound in ESS may shorten the learning curve of ESS and improve surgical efficiency and safety.