The middle rectal artery courses medially to supply the rectum. The vessel anastomoses with the superior rectal artery, which originates from the inferior mesenteric artery in the abdomen, and the inferior rectal artery, which originates from the internal pudendal artery in the perineum.