Spin-orbit interaction enables electrical tuning of spins, thus facilitating spintronics applications. It leads to spin precession about a momentum-dependent spin-orbit field. For a diffusive, two-dimensional electron gas the spin orientation at a given spatial position depends on which trajectory the electron travels to that point. Under increasing lateral confinement the spin orientation becomes independent on the trajectory and the formation of a long-lived helical spin mode is predicted. Here we visualize this transition experimentally in a GaAs quantum-well structure with isotropic spin-orbit interaction. Spatially resolved measurements show the formation of a helical mode already for nonquantized and nonballistic channels. We find a spin-lifetime enhancement that is in excellent agreement with theoretical predictions. Lateral confinement of a two-dimensional electron gas provides an easy-to-implement technique for achieving long spin lifetimes in the presence of strong spin-orbit interaction for a wide range of material systems.