The strong nuclear interaction between nucleons (protons and neutrons) is the effective force that holds the atomic nucleus together. This force stems from fundamental interactions between quarks and gluons (the constituents of nucleons) that are described by the equations of quantum chromodynamics. However, as these equations cannot be solved directly, nuclear interactions are described using simplified models, which are well constrained at typical inter-nucleon distances1–5 but not at shorter distances. This limits our ability to describe high-density nuclear matter such as that in the cores of neutron stars6. Here we use high-energy electron scattering measurements that isolate nucleon pairs in short-distance, high-momentum configurations7–9, accessing a kinematical regime that has not been previously explored by experiments, corresponding to relative momenta between the pair above 400 megaelectronvolts per c (c, speed of light in vacuum). As the relative momentum between two nucleons increases and their separation thereby decreases, we observe a transition from a spin-dependent tensor force to a predominantly spin-independent scalar force. These results demonstrate the usefulness of using such measurements to study the nuclear interaction at short distances and also support the use of point-like nucleon models with two- and three-body effective interactions to describe nuclear systems up to densities several times higher than the central density of the nucleus.