We analyze a confined multiple-ribbon M2.1 flare (SOL2015-01-29T11:42) that originated from a fan-spine coronal magnetic field configuration, within active region NOAA 12268. The observed ribbons form in two steps. First, two primary ribbons form at the main flare site, followed by the formation of secondary ribbons at remote locations. We observe a number of plasma flows at extreme-ultraviolet temperatures during the early phase of the flare (as early as 15 min before the onset) propagating towards the formation site of the secondary ribbons. The secondary ribbon formation is co-temporal with the arrival of the pre-flare generated plasma flows. The primary ribbons are co-spatial with RHESSI hard X-ray sources, whereas no enhanced X-ray emission is detected at the secondary ribbons sites. The (E)UV emission, associated with the secondary ribbons, peaks ∼1 min after the last RHESSI hard X-ray enhancement. A nonlinear force-free model of the coronal magnetic field reveals that the secondary flare ribbons are not directly connected to the primary ribbons, but to regions nearby. Detailed analysis suggests that the secondary brightenings are produced due to dissipation of kinetic energy of the plasma flows (heating due to compression), and not due to non-thermal particles accelerated by magnetic reconnection, as is the case for the primary ribbons.