The cavernous nerves on the prostate surface are responsible for erectile function. Optical diagnostic tools such as optical coherence tomography and laser nerve stimulation may assist in the identification, imaging, and preservation of these microscopic nerves during prostate cancer surgery, and thus, help preserve sexual function after surgery. The feasibility of noncontact laser stimulation of the cavernous nerves is demonstrated in an in vivo rat prostate model with comparison to conventional electrical nerve stimulation. High-resolution optical coherence tomographic images of the nerves are also obtained and compared with histology. These optical technologies may be suitable as surgical guidance tools during laparoscopic and robotic nerve-sparing prostate cancer surgery. © 2006 IEEE.