The 21-cm signal of neutral hydrogen is a sensitive probe of the Epoch of
Reionization, Cosmic Dawn and the Dark Ages. Currently operating radio
telescopes have ushered in a data-driven era of 21-cm cosmology, providing the
first constraints on the astrophysical properties of sources that drive this
signal. However, extracting astrophysical information from the data is highly
non-trivial and requires the rapid generation of theoretical templates over a
wide range of astrophysical parameters. To this end emulators are often
employed, with previous efforts focused on predicting the power spectrum. In
this work we introduce 21cmGEM -- the first emulator of the global 21-cm signal
from Cosmic Dawn and the Epoch of Reionization. The smoothness of the output
signal is guaranteed by design. We train neural networks to predict the
cosmological signal based on a seven-parameter astrophysical model, using a
database of $\sim$30,000 simulated signals. We test the performance with a set
of $\sim$2,000 simulated signals, showing that the relative error in the
prediction has an r.m.s. of 0.0159. The algorithm is efficient, with a running
time per parameter set of 0.16 sec. Finally, we use the database of models to
check the robustness of relations between the features of the global signal and
the astrophysical parameters that we previously reported. In particular, we
confirm the prediction that the coordinates of the maxima of the global signal,
if measured, can be used to estimate the Ly{\alpha} intensity and the X-ray
intensity at early cosmic times.