The sulphate-rich deposits at Meridiani Planum, Mars, discovered by the rover Opportunity, were proposed to be playa evaporites that had been reworked by eolian processes. Alternative hypotheses include volcanic or impact-driven formation of the sediments. Here we argue that the cation chemistry, scale, mineralogy and structure of the Meridiani sedimentary deposits are best explained by eolian or impact-driven reworking of the sublimation residue from a large-scale deposit consisting of dust and ice. We suggest that silicate material underwent significant acid weathering inside the ice deposit when thin films of water, formed through radiant heating, enabled the reaction between silicate material and sulphate-rich aerosols deposited from the atmosphere. The massive ice deposit could have formed during a period of high obliquity or polar wander, and subsequently sublimed away when obliquity changed or the pole moved to a new location. We propose acid weathering inside massive ice deposits as an explanation for the formation of many of the sulphate-rich layered deposits on Mars, which share many characteristics, including mineralogy, structure, erosional characteristics and size, with the sediments found at Meridiani Planum.