We discuss the deconfinement and the CP-breaking phase transitions at θ ¼ π in Yang-Mills theories. The 't Hooft anomaly matching prohibits the confined phase with CP symmetry and requires T dec ðθ ¼ πÞ ≤ T CP , where T dec ðθ ¼ πÞ and T CP denote the deconfinement and the CP-restoration temperatures, respectively, at θ ¼ π. We analytically study these two phase transitions in softly broken N ¼ 1 supersymmetric Yang-Mills theories on small R 3 × S 1 with the periodic boundary condition for gluinos. For most gauge groups except SU(2) in this model, we find that the inequality is saturated, so deconfinement and CP restoration occur simultaneously. We demonstrate special features of the SU(2) gauge theory: there is a finite window of two temperatures, T dec ðπÞ < T CP , which indicates the existence of a novel CP-broken deconfined phase. We also discuss an implication of the novel phase for domain walls and their junctions.