Electronic properties such as current flow are generally independent of the electron s spin angular momentum, an internal degree of freedom possessed by quantum particles. The spin Hall effect, first proposed 40 years ago(1), is an unusual class of phenomena in which flowing particles experience orthogonally directed, spin-dependent forces-analogous to the conventional Lorentz force that gives the Hall effect, but opposite in sign for two spin states. Spin Hall effects have been observed for electrons flowing in spin-orbit-coupled materials such as GaAs and InGaAs (refs 2, 3) and for laser light traversing dielectric junctions(4). Here we observe the spin Hall effect in a quantum-degenerate Bose gas, and use the resulting spin-dependent Lorentz forces to realize a cold-atom spin transistor. By engineering a spatially inhomogeneous spin-orbit coupling field for our quantum gas, we explicitly introduce and measure the requisite spin-dependent Lorentz forces, finding them to be in excellent agreement with our calculations. This atomtronic transistor behaves as a type of velocity-insensitive adiabatic spin selector, with potential application in devices such as magnetic(5) or inertial(6) sensors. In addition, such techniques for creating and measuring the spin Hall effect are clear prerequisites for engineering topological insulators(7,8) and detecting their associated quantized spin Hall effects in quantum gases. As implemented, our system realizes a laser-actuated analogue to the archetypal semiconductor spintronic device, the Datta-Das spin transistor(9,10).