Seismic tomography has been used to infer that some descending slabs of oceanic lithosphere plunge deep into the Earth's lower mantle. The fate of these slabs has remained unresolved, but it has been postulated that their ultimate destination is the lowermost few hundred kilometres of the mantle, known as the D'' region. Relatively cold slab material may account for high seismic velocities imaged in D'' beneath areas of long-lived plate subduction, and for reflections from a seismic velocity discontinuity just above the anomalously high wave speed regions. The D'' discontinuity itself is probably the result of a phase change in relatively low-temperature magnesium silicate perovskite. Here, we present images of the D'' region beneath the Cocos plate using Kirchhoff migration of horizontally polarized shear waves, and find a 100-km vertical step occurring over less than 100 km laterally in an otherwise flat D'' shear velocity discontinuity. Folding and piling of a cold slab that has reached the core-mantle boundary, as observed in numerical and experimental models, can account for the step by a 100-km elevation of the post-perovskite phase boundary due to a 700 degrees C lateral temperature reduction in the folded slab. We detect localized low velocities at the edge of the slab material, which may result from upwellings caused by the slab laterally displacing a thin hot thermal boundary layer.