Prostatectomy is a surgical procedure to partially or completely remove the prostate. It is primarily used to treat prostate cancer, but may also be used to treat benign prostatic hyperplasia (BPH) when other treatments have not been effective.