  In this article, we study the origin of precursor flare activity and
investigate its role towards triggering the eruption of a flux rope which
resulted into a dual-peak M-class flare (SOL2015-06-21T02:36) in the active
region NOAA 12371. The flare evolved in two distinct phases with peak flux
levels of M2.1 and M2.6 at an interval of $\approx$54 min. The active region
exhibited striking moving magnetic features (MMFs) along with sunspot rotation.
Non-linear force free field (NLFFF) modelling of the active region corona
reveals a magnetic flux rope along the polarity inversion line in the trailing
sunspot group which is observationally manifested by the co-spatial structures
of an active region filament and a hot channel identified in the 304 and 94
\AA\ images, respectively, from the Atmospheric Imaging Assembly (AIA). The
active region underwent a prolonged phase of flux enhancement followed by a
relatively shorter period of flux cancellation prior to the onset of the flare
which led to the build up and activation of the flux rope. Extreme ultra-violet
(EUV) images reveal localised and structured pre-flare emission, from the
region of MMFs, adjacent to the location of the main flare. Our analysis
reveals strong, localised regions of photospheric currents of opposite
polarities at the precursor location, thereby making the region susceptible to
small-scale magnetic reconnection. Precursor reconnection activity from this
location most likely induced a slipping reconnetion towards the northern leg of
the hot channel which led to the destabilization of the flux rope. The
application of magnetic virial theorem suggests that there was an overall
growth of magnetic free energy in the active region during the prolonged
pre-flare phase which decayed rapidly after the hot channel eruption and its
successful transformation into a halo coronal mass ejection (CME).
