In most cosmological models, rapid expansion of space marks the first moments of the Universe and leads to the amplification of quantum fluctuations1. The description of subsequent dynamics and related questions in cosmology requires an understanding of the quantum fields of the standard model and dark matter in curved spacetime. Even the reduced problem of a scalar quantum field in an explicitly time-dependent spacetime metric is a theoretical challenge2-5, and thus a quantum field simulator can lead to insights. Here we demonstrate such a quantum field simulator in a two-dimensional Bose-Einstein condensate with a configurable trap6,7 and adjustable interaction strength to implement this model system. We explicitly show the realization of spacetimes with positive and negative spatial curvature by wave-packet propagation and observe particle-pair production in controlled power-law expansion of space, using Sakharov oscillations to extract amplitude and phase information of the produced state. We find quantitative agreement with analytical predictions for different curvatures in time and space. This benchmarks and thereby establishes a quantum field simulator of a new class. In the future, straightforward upgrades offer the possibility to enter unexplored regimes that give further insight into relativistic quantum field dynamics.