Multidimensional imaging of transient events has proven critical in uncovering many fundamental mechanisms in physics, chemistry, and biology. In particular, real-time imaging modalities with ultrahigh temporal resolutions are required for capturing ultrashort events on picosecond timescales. Despite recent approaches witnessing a dramatic boost in high-speed photography, current single-shot ultrafast imaging schemes operate only at conventional optical wavelengths, being suitable solely within an optically-transparent framework. Here, leveraging on the unique penetration ability of terahertz (THz) waves, we demonstrate a single-shot ultrafast THz imaging system that can capture ultrashort events in optically-opaque scenarios. This is achieved by capitalizing the electro-optic sampling (EOS) technique for THz detection using a judiciously designed optical probe beam multiplexed in the time and spatial-frequency domains simultaneously. According to the EOS mechanism, THz waveforms can be coherently reconstructed by probing the birefringence induced by the THz electric field into an electro-optic crystal. Since the probe beam typically features a wavelength in the near-infrared region, it is possible to use a conventional charge-coupled device camera to map THz-induced variations in probe polarization, thus producing a 2D THz image. In particular, we find that multiplexing the probe beam allows us to encode the terahertz-captured three-dimensional dynamics into different and uniquely marked spatial-frequency regions in Fourier space. This leads to the formation of a superimposed image acquired by the camera, which can then be computationally decoded and reconstructed. Our single-shot method essentially bypasses the need for high-speed devices operating at THz wavelengths, yet it is powerful in providing the spatiotemporal evolution of a complex ultrafast scene with a sub-picosecond temporal resolution, corresponding to a frame rate of more than 1 trillion frames per second. We envisage that our system will provide unprecedented insights into a broad variety of exotic dynamics that occur in advanced materials that are not typically accessible to conventional optical frequencies.