A prostatectomy is a surgical procedure for the partial or complete removal of the prostate gland. The prostate is a small, walnut-sized gland in men that produces seminal fluid. This procedure is often performed to treat prostate cancer or benign prostatic hyperplasia (BPH).