The coexistence and competition between superconductivity and electronic orders, such as spin or charge density waves, have been a central issue in high transition-temperature (Tc) superconductors. Unlike other iron-based superconductors, FeSe exhibits nematic ordering without magnetism whose relationship with its superconductivity remains unclear. Moreover, a pressure-induced fourfold increase of Tc has been reported, which poses a profound mystery. Here we report high-pressure magnetotransport measurements in FeSe up to ∼15 GPa, which uncover the dome shape of magnetic phase superseding the nematic order. Above ∼6 GPa the sudden enhancement of superconductivity (Tc≤38.3 K) accompanies a suppression of magnetic order, demonstrating their competing nature with very similar energy scales. Above the magnetic dome, we find anomalous transport properties suggesting a possible pseudogap formation, whereas linear-in-temperature resistivity is observed in the normal states of the high-Tc phase above 6 GPa. The obtained phase diagram highlights unique features of FeSe among iron-based superconductors, but bears some resemblance to that of high-Tc cuprates.