In pipes and channels, the onset of turbulence is initially dominated by localized transients which eventually lead to a non-equilibrium phase transition to sustained turbulence. In the present study, we elucidate a state space structure that gives rise to transient chaos. Starting from the basin boundary separating laminar and turbulent flow, we identify transverse homoclinic orbits, presence of which necessitates chaos. The homoclinic tangle on the laminar-turbulent boundary verifies its fractal nature, a property that had been proposed in various earlier studies. By mapping the transversal intersections between the stable and unstable manifold of a periodic orbit, we identify the gateways that promote an escape from turbulence. 05.45.Jn, 47.27.ed In wall-bounded shear flows close to onset, turbulence can be observed as localized patches that coexist with the orderly laminar flow that is stable against infinitesimal disturbances. In the case of pipe flow, these localized structures are known as puffs and they have a simple phenomenology: After a chaotic time-evolution, a puff might suddenly decay and disappear or split and give rise to a new puff. As the governing parameter, the Reynolds number (Re), is increased, the mean puff lifetime before decaying increases while that before a splitting event decline. This phenomenology was recently exploited to conceptualize a spatiotemporal description of the transition [1, 2]: In an infinitely long pipe that is initially populated with many puffs, turbulence will be sustained if the rate of puff splitting exceeds that of decay. Consequently, a critical Re C is defined as the Re, at which both rates are equal.In addition to allowing for a clear definition of the critical Re C , the spatiotemporal dynamics also revealed universal properties of the transition to turbulence: critical exponents were determined in laboratory experiments for Couette flow [3] and in direct numerical simulations for Couette [3] and Waleffe flow [4] and these suggest that the transition falls into the universality class of directed percolation.Key to the above scenario is the existence of spatially discrete chaotic transients. While the transient chaotic nature of the puff dynamics is evident from observations, how such dynamics arise from the Navier-Stokes equations is not well understood. Even though localized asymptotic states [5] and invariant solutions [6,7] at the laminar-turbulent boundary were computed, dynamical routes for sudden puff decay across the stable manifold of such solutions were not identified. In this Letter, we demonstrate the existence of homoclinic orbits in the vicinity of a periodic solution, which itself is on the laminar-turbulent boundary. Based on this observation, we suggest a global picture of the state space, containing a Smale horseshoe, which gives rise to transient chaos with a fractal basin boundary and thus, infinitely many paths for puff decay.We simulate the incompressible fluid flow through a circular pipe of diameter D and length L = πD/0.1256637 ≈ 25...