Nuclear magic numbers correspond to fully occupied energy shells of protons or neutrons inside atomic nuclei. Doubly magic nuclei, with magic numbers for both protons and neutrons, are spherical and extremely rare across the nuclear landscape. Although the sequence of magic numbers is well established for stable nuclei, experimental evidence has revealed modifications for nuclei with a large asymmetry between proton and neutron numbers. Here we provide a spectroscopic study of the doubly magic nucleus 78Ni, which contains fourteen neutrons more than the heaviest stable nickel isotope. We provide direct evidence of its doubly magic nature, which is also predicted by ab initio calculations based on chiral effective-field theory interactions and the quasi-particle random-phase approximation. Our results also indicate the breakdown of the neutron magic number 50 and proton magic number 28 beyond this stronghold, caused by a competing deformed structure. State-of-the-art phenomenological shell-model calculations reproduce this shape coexistence, predicting a rapid transition from spherical to deformed ground states, with 78Ni as the turning point.