  We present an updated cosmic-ray mass composition analysis in the energy
range $10^{16.8}$ to $10^{18.3}$ eV from 334 air showers measured with the
LOFAR radio telescope, and selected for minimal bias. In this energy range, the
origin of cosmic rays is expected to shift from galactic to extragalactic
sources. The analysis is based on an improved method to infer the depth of
maximum $X_{\rm max}$ of extensive air showers from radio measurements and air
shower simulations.
  We show results of the average and standard deviation of $X_{\rm max}$ versus
primary energy, and analyze the $X_{\rm max}$-dataset at distribution level to
estimate the cosmic ray mass composition. Our approach uses an unbinned maximum
likelihood analysis, making use of existing parametrizations of $X_{\rm
max}$-distributions per element. The analysis has been repeated for three main
models of hadronic interactions.
  Results are consistent with a significant light-mass fraction, at best fit
$23$ to $39$ $\%$ protons plus helium, depending on the choice of hadronic
interaction model. The fraction of intermediate-mass nuclei dominates. This
confirms earlier results from LOFAR, with systematic uncertainties on $X_{\rm
max}$ now lowered to 7 to $9$ $\mathrm{g/cm^2}$.
  We find agreement in mass composition compared to results from Pierre Auger
Observatory, within statistical and systematic uncertainties. However, in line
with earlier LOFAR results, we find a slightly lower average $X_{\rm max}$. The
values are in tension with those found at Pierre Auger Observatory, but agree
with results from other cosmic ray observatories based in the Northern
hemisphere.
