  The pairing mechanism in iron-based superconductors is the subject of ongoing
debate. Proximity to an antiferromagnetic phase suggests that pairing is
mediated by spin fluctuations, but orbital fluctuations have also been invoked.
The former typically favour a pairing state of extended s-wave symmetry with a
gap that changes sign between electron and hole Fermi surfaces (s+-), while the
latter yield a standard s-wave state without sign change (s++). Here we show
that applying pressure to KFe2As2 induces a change of pairing state. The
critical temperature Tc decreases with pressure initially, and then suddenly
increases, above a critical pressure Pc. The constancy of the Hall coefficient
through Pc rules out a change in the Fermi surface. There is compelling
evidence that the pairing state below Pc is d-wave, from bulk measurements at
ambient pressure. Above Pc, the high sensitivity to disorder argues for a
particular kind of s+- state. The change from d-wave to s-wave is likely to
proceed via an unusual s + id state that breaks time-reversal symmetry. The
proximity of two distinct pairing states found here experimentally is natural
given the near degeneracy of d-wave and s+- states found theoretically. These
findings make a compelling case for spin-fluctuation-mediated superconductivity
in this key iron-arsenide material.
