We describe the observation of GW170104, a gravitational-wave signal produced by the coalescence of a pair of stellar-mass black holes. The signal was measured on January 4, 2017 at 10∶11:58.6 UTC by the twin advanced detectors of the Laser Interferometer Gravitational-Wave Observatory during their second observing run, with a network signal-to-noise ratio of 13 and a false alarm rate less than 1 in 70 000 years. The inferred component black hole masses are 31. 2 + 8.4 − 6.0 M ⊙ and 19. 4 + 5.3 − 5.9 M ⊙ (at the 90% credible level). The black hole spins are best constrained through measurement of the effective inspiral spin parameter, a mass-weighted combination of the spin components perpendicular to the orbital plane, χ eff = − 0.1 2 + 0.21 − 0.30 . This result implies that spin configurations with both component spins positively aligned with the orbital angular momentum are disfavored. The source luminosity distance is 88 0 + 450 − 390 Mpc corresponding to a redshift of z = 0.1 8 + 0.08 − 0.07 . We constrain the magnitude of modifications to the gravitational-wave dispersion relation and perform null tests of general relativity. Assuming that gravitons are dispersed in vacuum like massive particles, we bound the graviton mass to m g ≤ 7.7 × 10 − 23 eV / c 2 . In all cases, we find that GW170104 is consistent with general relativity.