  Einstein's theory of gravity, general relativity, has passed stringent tests
in laboratories, elsewhere in the Solar Sytem, and in pulsar binaries.
Nevertheless it is known to be incompatible with quantum mechanics and must
differ from the true behaviour of matter in strong fields and at small spatial
scales. A key aspect of general relativity to test is the strong equivalence
principle (SEP), which states that all freely falling objects, regardless of
how strong their gravity, experience the same acceleration in the same
gravitational field. Essentially all alternatives to general relativity violate
this principle at some level. Previous direct tests of the SEP are limited by
the weak gravity of the bodies in the Earth-Moon-Sun system or by the weak
gravitational pull of the Galaxy on pulsar-white dwarf binaries. PSR~J0337+1715
is a hierarchical stellar triple system, where the inner binary consists of a
millisecond radio pulsar in a $1.6$-day orbit with a white dwarf. This inner
binary is in a $327$-day orbit with another white dwarf. In this system, the
pulsar and the inner companion fall toward the outer companion with an
acceleration about $10^8$ times greater than that produced by falling in the
Galactic potential, and the pulsar's gravitational binding energy is roughly
$10\%$ of its mass. Here we report that in spite of the pulsar's strong
gravity, the accelerations experienced by it and the inner white dwarf differ
by a fraction of no more than $2.6\times 10^{-6}$ ($95\%$ confidence level). We
can roughly compare this to other SEP tests by using the strong-field Nordtvedt
parameter $\hat\eta_N$. Our limit on $\hat\eta_N$ is a factor of ten smaller
than that obtained from (weak-field) Solar-System SEP tests and a factor of
almost a thousand smaller than that obtained from other strong-field SEP tests.
