The detection of GW170817 in both gravitational waves and electromagnetic waves heralds the age of gravitational-wave multi-messenger astronomy. On 17 August 2017 the Advanced LIGO and Virgo detectors observed GW170817, a strong signal from the merger of a binary neutron-star system. Less than 2 seconds after the merger, a gamma-ray burst (GRB 170817A) was detected within a region of the sky consistent with the LIGO-Virgo-derived location of the gravitational-wave source. This sky region was subsequently observed by optical astronomy facilities, resulting in the identification of an optical transient signal within ∼10arcsec of the galaxy NGC 4993. These multi-messenger observations allow us to use GW170817 as a standard siren, the gravitational-wave analog of an astronomical standard candle, to measure the Hubble constant. This quantity, which represents the local expansion rate of the Universe, sets the overall scale of the Universe and is of fundamental importance to cosmology. Our measurement combines the distance to the source inferred purely from the gravitational-wave signal with the recession velocity inferred from measurements of the redshift using electromagnetic data. This approach does not require any form of cosmic "distance ladder;" the gravitational wave analysis can be used to estimate the luminosity distance out to cosmological scales directly, without the use of intermediate astronomical distance measurements. We determine the Hubble constant to be 70.0+12.0−8.0kms−1Mpc−1 (maximum a posteriori and 68% credible interval). This is consistent with existing measurements, while being completely independent of them. Additional standard-siren measurements from future gravitational-wave sources will provide precision constraints of this important cosmological parameter.