Context. Ellerman bombs (EBs) are enhanced emission in the wings of the Hα line in the solar spectrum. Aims. We study the structure of an EB in the photosphere and chromosphere.Methods. We analyze simultaneous observations of four chromospheric lines (Hα, Ca ii H, Ca ii IR 854 nm, and He i 1083 nm) as well as two photospheric lines (Fe i 630 and Si i 1082.7 nm) along with high-cadence 160 and 170 nm ultraviolet (UV) continuum filtergrams. Full Stokes data from the Helioseismic and Magnetic Imager (HMI) are used to trace the temporal evolution of the magnetic structure.Results. We identify the EB by excess emission in the wings of the Hα line, a brightening in the UV continuum, and large emission peaks in the core of the two Ca ii lines. The EB shows a blueshift in all chromospheric lines, while no shifts are observed in the photospheric lines. The blueshift in the chromospheric layer causes very asymmetric emission peaks in the Ca ii H line. The photospheric Si i spectral line shows a shallower line depth at the location of the EB. The UV continuum maps show that the EB was substantially brighter than its surroundings for about 30 min. The continuum contrast of the EB from 170 nm to 1080 nm shows a power-law dependency on the wavelength. The temperature enhancement amounts to 130 K in the low photosphere and 400 K at the temperature minimum level. This temperature excess is also seen in an LTE inversion of the Ca ii spectra. The total thermal and radiative energy content of the EB is about 10 20 J and 10 18 J in the photosphere and chromosphere, respectively. The HMI data hints at a photospheric magnetic flux cancellation as the driver of the EB. Conclusions. Ellerman bombs release the energy in a height range of several pressure scale heights around the temperature minimum such that they affect both the photosphere and the lower chromosphere.