Comets are composed of dust and frozen gases. The ices are mixed with the refractory material either as an icy conglomerate, or as an aggregate of pre-solar grains (grains that existed prior to the formation of the Solar System), mantled by an ice layer. The presence of water-ice grains in periodic comets is now well established. Modelling of infrared spectra obtained about ten kilometres from the nucleus of comet Hartley 2 suggests that larger dust particles are being physically decoupled from fine-grained water-ice particles that may be aggregates, which supports the icy-conglomerate model. It is known that comets build up crusts of dust that are subsequently shed as they approach perihelion. Micrometre-sized interplanetary dust particles collected in the Earth's stratosphere and certain micrometeorites are assumed to be of cometary origin. Here we report that grains collected from the Jupiter-family comet 67P/Churyumov-Gerasimenko come from a dusty crust that quenches the material outflow activity at the comet surface. The larger grains (exceeding 50 micrometres across) are fluffy (with porosity over 50 per cent), and many shattered when collected on the target plate, suggesting that they are agglomerates of entities in the size range of interplanetary dust particles. Their surfaces are generally rich in sodium, which explains the high sodium abundance in cometary meteoroids. The particles collected to date therefore probably represent parent material of interplanetary dust particles. This argues against comet dust being composed of a silicate core mantled by organic refractory material and then by a mixture of water-dominated ices. At its previous recurrence (orbital period 6.5 years), the comet's dust production doubled when it was between 2.7 and 2.5 astronomical units from the Sun, indicating that this was when the nucleus shed its mantle. Once the mantle is shed, unprocessed material starts to supply the developing coma, radically changing its dust component, which then also contains icy grains, as detected during encounters with other comets closer to the Sun.