The peculiar object P/2010 A2 was discovered1 in January 2010 and given a cometary designation because of the presence of a trail of material, although there was no central condensation or coma. The appearance of this object, in an asteroidal orbit (small eccentricity and inclination) in the inner main asteroid belt attracted attention as a potential new member of the recently recognized2 class of main-belt comets. If confirmed, this new object would expand the range in heliocentric distance over which main-belt comets are found. Here we report observations of P/2010 A2 by the Rosetta spacecraft. We conclude that the trail arose from a single event, rather than a period of cometary activity, in agreement with independent results3. The trail is made up of relatively large particles of millimetre to centimetre size that remain close to the parent asteroid. The shape of the trail can be explained by an initial impact ejecting large clumps of debris that disintegrated and dispersed almost immediately. We determine that this was an asteroid collision that occurred around 10 February 2009.