
•Eighteen patients underwent real-time in vivo optical biopsy using CLE in surgery.
•Optical biopsy using CLE was performed when the rectum was dissected at the levator ani plane and rectum transection was ready. For negative DM, the surgical procedure of low anterior resection (LAR) was chosen. For positive DM, the surgical procedure of abdominoperineal resection (APR) was chosen.
•The specimen at the site of the planned transection rectum underwent intraoperative frozen section and routine pathological procedures.

•Eleven patients' CLE images of DM showed a regular, round crypt, and round luminal opening covered by a simple layer of columnar epithelial cells and goblet cells. LAR was then performed. Pathology revealed that the 11 DMs were negative, and the median length of the DMs was 2.0 cm. The remaining seven patients' CLE images of the planned transection rectum showed the loss of crypt architecture and irregular epithelial layer with loss of goblet cells. APR was then performed. Pathology confirmed cancer invasion, and the median distance from tumor to dentate line was 1.0 cm.
•The sensitivity, specificity, and accuracy of CLE optical biopsy of DM were 85.71%, 100%, and 94.44%, respectively.