Physical systems with loss or gain have resonant modes that decay or grow exponentially with time. Whenever two such modes coalesce both in their resonant frequency and their rate of decay or growth, an 'exceptional point' occurs, giving rise to fascinating phenomena that defy our physical intuition. Particularly intriguing behaviour is predicted to appear when an exceptional point is encircled sufficiently slowly, such as a state-flip or the accumulation of a geometric phase. The topological structure of exceptional points has been experimentally explored, but a full dynamical encircling of such a point and the associated breakdown of adiabaticity have remained out of reach of measurement. Here we demonstrate that a dynamical encircling of an exceptional point is analogous to the scattering through a two-mode waveguide with suitably designed boundaries and losses. We present experimental results from a corresponding waveguide structure that steers incoming waves around an exceptional point during the transmission process. In this way, mode transitions are induced that transform this device into a robust and asymmetric switch between different waveguide modes. This work will enable the exploration of exceptional point physics in system control and state transfer schemes at the crossroads between fundamental research and practical applications.