Convection in the Earth’s mantle is mainly driven by cold, dense subducting slabs, but relatively little is known about how 3D variations in slab morphology and buoyancy affect mantle flow or how the surface above deforms in response (i.e. dynamic topography). We investigate this problem by studying the dynamics of an active region of flat-slab subduction located in Peru in South America. Here the slab geometry is well known, based on the regional seismicity, and we have observations from the local geological record to validate our models. Of particular interest is the widespread subsidence and deposition of the Solimoes Formation across western Amazonia that coincided with the development of the Peruvian flat-slab during the Mid-Late Miocene. This formation covers an extensive area from the foredeep to the Purus Arch located similar to 2000 km away from the trench. Close to the Andes the preservation of several kilometers of sedimentary thicknesses can be easily accounted for by flexure. Based on an estimate of the Andean loading we predict 2.8 to 3.6 km of accommodation space that spans 100 km. The spatial and temporal history of the Solimoes Formation however, particularly the thick distal foreland accumulations up to 1.2 km deep, can only be matched with the addition of a longer-wavelength dynamic source of topography. Following the transition from normal to flat subduction, we predict over 1 km of dynamic subsidence (similar to 1500 km wide) that propagates over 1000 km away from the trench, tracking the subduction leading edge. This is followed by a pulse of dynamic uplift over the flat segment behind it. We therefore propose that a combination of uplift, flexure and dynamic topography during slab flattening in Peru is responsible for the sedimentation history and landscape evolution of western Amazonia that eventually led to the configuration of the Amazon Drainage Basin we know today. (C) 2014 Elsevier B.V. All rights reserved.