Removing the prostate, or radical prostatectomy, is used to eliminate the cancer when it is confined to the prostate. New techniques use smaller incisions and seek to avoid damaging nearby nerves. If lymph nodes are also cancerous, prostatectomy may not be the best option. Surgery may impair urinary and sexual function, but both can improve over time.