Neutron stars are composed of the densest form of matter known to exist in our Universe, the composition and properties of which are still theoretically uncertain. Measurements of the masses or radii of these objects can strongly constrain the neutron star matter equation of state and rule out theoretical models of their composition. The observed range of neutron star masses, however, has hitherto been too narrow to rule out many predictions of 'exotic' non-nucleonic components. The Shapiro delay is a general-relativistic increase in light travel time through the curved space-time near a massive body. For highly inclined (nearly edge-on) binary millisecond radio pulsar systems, this effect allows us to infer the masses of both the neutron star and its binary companion to high precision. Here we present radio timing observations of the binary millisecond pulsar J1614-2230 that show a strong Shapiro delay signature. We calculate the pulsar mass to be (1.97 ± 0.04)M(⊙), which rules out almost all currently proposed hyperon or boson condensate equations of state (M(⊙), solar mass). Quark matter can support a star this massive only if the quarks are strongly interacting and are therefore not 'free' quarks.