Aims. We present a spectroscopic study of a sample of 287 planetary nebulas (PNs) around the brightest cluster galaxy (BCG) M 87 in Virgo A, of which 211 are located between 40 kpc and 150 kpc from the galaxy centre. With these data we can distinguish the stellar halo from the co-spatial intracluster light (ICL) and study both components separately. Methods. We obtained PN velocities with a high resolution FLAMES/VLT survey targeting eight fields in a total area of ∼0.4 deg 2 . We identified PNs from their narrow and symmetric redshifted λ5007 Å [OIII] emission line, the presence of the second λ4959 Å [OIII] emission line, and the absence of significant continuum. We implement a robust technique to measure the halo velocity dispersion from the projected phase-space to identify PNs associated with the M 87 halo and ICL. Using photometric magnitudes, we construct PN luminosity functions (PNLFs), which are complete down to m 5007 = 28.8. Results. The velocity distribution of the spectroscopically confirmed PNs is bimodal, containing a narrow component centred on the systemic velocity of the BCG and an off-centred broader component, which we identify as halo and ICL, respectively. We find that 243 PNs are part of the velocity distribution of the M 87 halo, while the remaining subsample of 44 PNs are intracluster PNs (ICPNs). Halo and ICPNs have different spatial distributions: the number density of halo PNs follow the galaxy's surface brightness profile, whereas the ICPNs are characterised by a shallower power-law profile, I ICL ∝ R γ with γ in the range [−0.34, −0.04]. No evidence is found for an asymmetry in the halo and ICPN density distributions when the NW and SE fields are studied separately. A study of the composite PN number density profile confirms the superposition of different PN populations associated with the M 87 halo and the ICL, characterised by different PN specific numbers α. We derive α halo = 1.06 × 10 −8 N PN L −1 ,bol and α ICL = 2.72 × 10 −8 N PN L −1 ,bol , respectively. The M 87 halo PNLF has fewer bright PNs and a steeper slope towards faint magnitudes than the ICPNLF, and both are steeper than the standard PNLF for the M 31 bulge. Moreover, the ICPNLF has a dip at ∼1−1.5 mag fainter than the bright cut-off, reminiscent of the PNLFs of systems with extended star formation history, such as M 33 or the Magellanic clouds. Conclusions. The BCG halo of M 87 and the Virgo ICL are dynamically distinct components with different density profiles and velocity distributions. Moreover, the different α-parameter values and PNLF shapes of the halo and ICL indicate distinct parent stellar populations, consistent with the existence of a gradient towards bluer colours at large radii. These results reflect the hierarchical build-up of the Virgo cluster.