The propagation of a shock wave in solids can stress them to ultra-high pressures of millions of atmospheres. Understanding the behavior of matter at these extreme pressures is essential to describe a wide range of physical phenomena, including the formation of planets, young stars and cores of super-Earths, as well as the behavior of advanced ceramic materials subjected to such stresses. Under megabar (Mbar) pressure, even a solid with high strength exhibits plastic properties, causing the shock wave to split in two. This phenomenon is described by theoretical models, but without direct experimental measurements to confirm them, their validity is still in doubt. Here, we present the results of an experiment in which the evolution of the coupled elastic-plastic wave structure in diamond was directly observed and studied with submicron spatial resolution, using the unique capabilities of the X-ray free-electron laser. The direct measurements allowed, for the first time, the fitting and validation of a strength model for diamond in the range of several Mbar by performing continuum mechanics simulations in 2D geometry. The presented experimental approach to the study of shock waves in solids opens up new possibilities for the direct verification and construction of the equations of state of matter in the ultra-high pressure range, which are relevant for the solution of a variety of problems in high energy density physics.