We discuss the phase diagram of QCD in the presence of a strong background magnetic field, providing numerical evidence, based on lattice simulations of QCD with 2+1 flavours and physical quark masses, that the QCD crossover turns into a first order phase transition for large enough magnetic field, with a critical endpoint located between eB=4 GeV2 (where we found an analytic crossover at a pseudo-critical temperature Tc=(98±3) MeV) and eB=9 GeV2 (where the measured critical temperature is Tc=(63±5) MeV).