Strong interactions between single spins and photons are essential for quantum networks and distributed quantum computation. They provide the necessary interface for entanglement distribution, non-destructive quantum measurements, and strong photon-photon interactions. Achieving spin-photon interactions in a solid-state device could enable compact chip-integrated quantum circuits operating at gigahertz bandwidths. Many theoretical works have suggested using spins embedded in nanophotonic structures to attain this high-speed interface. These proposals exploit strong light-matter interactions to implement a quantum switch, where the spin flips the state of the photon and a photon flips the spin-state. However, such a switch has not yet been realized using a solid-state spin system. Here, we report an experimental realization of a spin-photon quantum switch using a single solid-state spin embedded in a nanophotonic cavity. We show that the spin-state strongly modulates the cavity reflection coefficient, which conditionally flips the polarization state of a reflected photon on picosecond timescales. We also demonstrate the complementary effect where a single photon reflected from the cavity coherently rotates the spin. These strong spin-photon interactions open up a promising direction for solid-state implementations of high-speed quantum networks and on-chip quantum information processors using nanophotonic devices.