Pelvic exenteration
This is a major surgical procedure and only used when a cancer has already spread from the rectum to nearby organs.
The surgery removes not only the rectum, but also the lower colon, and the bladder if already invaded by cancer. The lymph nodes, as well as the uterus, vagina, and ovaries (in the woman), or the prostate (in the man) might also be removed.
In a pelvic exenteration, there may be a need to construct artificial holes to collect the urine (to do a urostomy) and feces (colostomy) in bags outside of the body.