Abstract Dedicated longitudinal electron beam diagnostics is highly demanded for the control and optimization of modern X-ray free-electron lasers (XFEL). At the European XFEL (E-XFEL), 3 transverse deflecting structures (TDS) will be installed at different locations of the accelerator for measurements of slice emittance and longitudinal profile. Operation of a TDS in combined use with an energy spectrometer, e.g. a dispersive section after a single dipole magnet, allows additionally for longitudinal phase space measurements. However, utilization of a dipole magnet is not compatible with single-bunch measurements in multibunch operation mode, which will be the standard operation mode of the E-XFEL. In this paper, we propose a longitudinal phase space diagnostic beamline consisting of a TDS, fast kicker and septum magnet for the E-XFEL. The layout of the accelerator lattice with optimized optics for longitudinal phase space measurements and numerical simulation studying the performance of the beamline will be presented