  Aims: Changes of the magnetic field and the line-of-sight velocities in the
photosphere are being reported for an M-class flare that originated at a
$\delta$-spot belonging to active region NOAA 11865.
  Methods: High-resolution ground-based near-infrared spectropolarimetric
observations were acquired simultaneously in two photospheric spectral lines,
Fe I 10783 \AA\ and Si I 10786 \AA, with the Tenerife Infrared Polarimeter at
the Vacuum Tower Telescope (VTT) in Tenerife on 2013 October 15. The
observations covered several stages of the M-class flare. Inversions of the
full-Stokes vector of both lines were carried out and the results were put into
context using (extreme)-ultraviolet filtergrams from the Solar Dynamics
Observatory (SDO).
  Results: The active region showed high flaring activity during the whole
observing period. After the M-class flare, the longitudinal magnetic field did
not show significant changes along the polarity inversion line (PIL). However,
an enhancement of the transverse magnetic field of approximately 550 G was
found that bridges the PIL and connects umbrae of opposite polarities in the
$\delta$-spot. At the same time, a newly formed system of loops appeared
co-spatially in the corona as seen in 171 \AA\ filtergrams of the Atmospheric
Imaging Assembly (AIA) on board SDO. However, we cannot exclude that the
magnetic connection between the umbrae already existed in the upper atmosphere
before the M-class flare and became visible only later when it was filled with
hot plasma. The photospheric Doppler velocities show a persistent upflow
pattern along the PIL without significant changes due to the flare.
  Conclusions: The increase of the transverse component of the magnetic field
after the flare together with the newly formed loop system in the corona
support recent predictions of flare models and flare observations.
