The length of time that a quantum system can exist in a superposition state is determined by how strongly it interacts with its environment. This interaction entangles the quantum state with the inherent fluctuations of the environment. If these fluctuations are not measured, the environment can be viewed as a source of noise, causing random evolution of the quantum system from an initially pure state into a statistical mixture-a process known as decoherence. However, by accurately measuring the environment in real time, the quantum system can be maintained in a pure state and its time evolution described by a quantum trajectory conditioned on the measurement outcome. We employ weak measurements to monitor a microwave cavity embedding a superconducting qubit and track the individual quantum trajectories of the system. In this architecture, the environment is dominated by the fluctuations of a single electromagnetic mode of the cavity. Using a near-quantum-limited parametric amplifier, we selectively measure either the phase or amplitude of the cavity field, and thereby confine trajectories to either the equator or a meridian of the Bloch sphere. We perform quantum state tomography at discrete times along the trajectory to verify that we have faithfully tracked the state of the quantum system as it diffuses on the surface of the Bloch sphere. Our results demonstrate that decoherence can be mitigated by environmental monitoring and validate the foundations of quantum feedback approaches based on Bayesian statistics. Moreover, our experiments suggest a new route for implementing what Schrodinger termed quantum steering-harnessing action at a distance to manipulate quantum states via measurement.