The efficacy of diversion ileostomy followed by radical surgery for locally advanced upper-half rectal cancer remains uncertain. This study seeks to compare the effectiveness of treatment with and without diversion ileostomy in preventing anastomotic leakage (AL) and to identify a subset who may benefit from diversion ileostomy after AL occurs in Chinese patients with stage II and III upper-half rectal cancer. A retrospective study enrolled a total of 809 patients with locally advanced upper-half rectal cancer between 2017 and 2021, with 27.6% (n = 223) treated with diversion ileostomy and 72.4% (n = 586) treated without diversion ileostomy. The Diversion(+) group (n = 172) and Diversion(-) group (n = 172) were compared for perioperative outcomes through 1:1 propensity score matching (PSM). The selection of variables for multivariable logistic regression was determined through bivariate logistic regression analysis. Additionally, optimal cutoff values for risk factors were identified using ROC curve analysis. Within the entire cohort, patients in the Diversion(+) group exhibited a lower distance from the anal verge (DAV) and higher rates of chemoradiotherapy (CRT), diabetes, cN2 stage, mrCRM positivity, EMVI positivity, and CEA elevation compared to those in the Diversion(-) group. Following PSM, a satisfactory balance of baseline variables was achieved between the two groups. There were no statistically significant differences in AL rates (7.0% vs. 5.8%, p = 0.659) or AL grade distribution (Grade A: 0.6% vs. 0%, Grade B: 5.2% vs. 4.1%, Grade C: 1.2% vs. 1.7%, p = 0.691) between the two groups. However, the Diversion(+) group demonstrated a higher incidence of postoperative complications (30.8% vs. 17.4%, p = 0.004), Clavien‒Dindo III-IV complications (2.9% vs. 2.3%, p = 0.013), particularly wound infections (8.1% vs. 1.2%, p = 0.002), and early postoperative inflammatory small bowel obstruction (EPISBO) (8.7% vs. 1.2%, p = 0.001) compared to the Diversion(-) group. Results from multivariate logistic regression analysis revealed that male gender (OR = 2.354, p = 0.014) was the only independent risk factor associated with AL, while the presence of diversion ileostomy (with vs. without, OR = 1.144, p = 0.686) did not show significant associations. In patients with AL, the onset of the AL was observed to occur later in the Diversion(+) group compared to the Diversion(-) group (7.0 ± 3.3 vs. 3.4 ± 1.4 days, p < 0.001), while the recovery time was significantly shorter (11.3 ± 4.7 vs. 20.3 ± 7.2 days, p < 0.001). Similarly, in Grade C AL patients, the occurence time was delayed in the Diversion(+) group compared to the Diversion(-) group (8.7 ± 4.7 vs. 3.2 ± 1.5 days, p = 0.008), with a shorter recovery time (19.3 ± 2.1 vs. 25.7 ± 6.7 days, p = 0.031). A trend was observed indicating a longer interval before ileostomy restoration in the AL patients compared to the non-AL patients (7.6 ± 4.9 months vs. 5.5 ± 2.9 months, p = 0.079). In addition, DAV (OR = 0.078, p = 0.002) was identified as the only independent factor associated with potential-diversion-benefit in patients with AL, with an optimal cutoff point of 8.6cm. The utilization of diversion ileostomy as a preventative measure for AL in cases of locally advanced upper-half rectal cancer is not universally endorsed due to potential complications such as small bowel obstruction and wound infection. Nevertheless, in the occurrence of AL, diversion ileostomy may prove advantageous for patient recuperation. Particularly, male patients with a DAV ranging from 7 to 8.6cm may experience benefits from undergoing diversion ileostomy subsequent to AL in cases of locally advanced upper-half rectal cancer.