Finding ways to achieve higher values of the transition temperature, Tc, in superconductors remains a great challenge. The superconducting phase is often one of several competing types of electronic order, including antiferromagnetism and charge density waves1, 2, 3, 4, 5. An emerging trend documented in heavy-fermion1 and organic2 conductors is that the maximum Tc for superconductivity occurs under external conditions that cause the critical temperature for a competing order to go to zero. Recently, such competition has been found in multilayer copper oxide high-temperature superconductors (HTSCs3, 4, 5) that possess two crystallographically inequivalent CuO2 planes in the unit cell. However, whether the competing electronic state can be suppressed to enhance Tc in HTSCs remains an open question. Here we show that pressure-driven phase competition leads to an unusual two-step enhancement of Tc in optimally doped trilayer Bi2Sr2Ca2Cu3O10+δ (Bi2223). We find that Tc first increases with pressure and then decreases after passing through a maximum. Unexpectedly, Tc increases again when the pressure is further raised above a critical value of around 24GPa, surpassing the first maximum. The presence of this critical pressure is a manifestation of the crossover from the competing order to superconductivity in the inner of the three CuO2 planes. We suggest that the increase at higher pressures occurs as a result of competition between pairing and phase ordering in different CuO2 planes.