  The milestone discovery of GW 170817-GRB 170817A-AT 2017gfo has shown that
gravitational wave (GW) could be produced during the merger of neutron
star-neutron star/black hole and that in electromagnetic (EM) wave a gamma-ray
burst (GRB) and a kilonova (KN) are generated in sequence after the merger.
Observationally, however, EM property before the merger phase is still unclear.
Here we report a peculiar precursor in a KN-associated long-duration GRB
211211A, providing evidence of the EM before the merger. This precursor lasts
$\sim$ 0.2 s, and the waiting time between the precursor and the main burst is
$\sim$ 1 s, comparable to that between GW 170817 and GRB 170817A. The spectrum
of the precursor could be well fit with a non-thermal cutoff power-law model
instead of a blackbody. Especially, a $\sim$22 Hz Quasi-Periodic Oscillation
candidate ($\sim 3\sigma$) is detected in the precursor. These temporal and
spectral properties indicate that this precursor is probably produced by a
catastrophic flare accompanying with magnetoelastic or crustal oscillations of
a magnetar in binary compact merger. The strong magnetic field of the magnetar
can also account for the prolonged duration of GRB 211211A. However, it poses a
challenge to reconcile the rather short lifetime of a magnetar with the rather
long spiraling time of a binary neutron star system only by the GW radiation
before merger.
