  The atmospheric depth of the air shower maximum $X_{\mathrm{max}}$ is an
observable commonly used for the determination of the nuclear mass composition
of ultra-high energy cosmic rays. Direct measurements of $X_{\mathrm{max}}$ are
performed using observations of the longitudinal shower development with
fluorescence telescopes. At the same time, several methods have been proposed
for an indirect estimation of $X_{\mathrm{max}}$ from the characteristics of
the shower particles registered with surface detector arrays. In this paper, we
present a deep neural network (DNN) for the estimation of $X_{\mathrm{max}}$.
The reconstruction relies on the signals induced by shower particles in the
ground based water-Cherenkov detectors of the Pierre Auger Observatory. The
network architecture features recurrent long short-term memory layers to
process the temporal structure of signals and hexagonal convolutions to exploit
the symmetry of the surface detector array. We evaluate the performance of the
network using air showers simulated with three different hadronic interaction
models. Thereafter, we account for long-term detector effects and calibrate the
reconstructed $X_{\mathrm{max}}$ using fluorescence measurements. Finally, we
show that the event-by-event resolution in the reconstruction of the shower
maximum improves with increasing shower energy and reaches less than
$25~\mathrm{g/cm^{2}}$ at energies above $2\times 10^{19}~\mathrm{eV}$.
