Our goal is to study the termination of an AGN jet in the young universe and to deduce physical parameters of the jet and the intergalactic medium. We use LOFAR to image the long-wavelength radio emission of the high-redshift blazar S5 0836+710 on arcsecond scales between 120 MHz and 160 MHz. The LOFAR image shows a compact unresolved core and a resolved emission region about 1.5 arcsec to the southwest of the radio core. This structure is in general agreement with previous higher-frequency radio observations with MERLIN and the VLA. The southern component shows a moderately steep spectrum with a spectral index of about $gtrsim -1$ while the spectral index of the core is flat to slightly inverted. In addition, we detect for the first time a resolved steep-spectrum halo with a spectral index of about $-1$ surrounding the core. The arcsecond-scale radio structure of S5 0836+710 can be understood as an FR II-like radio galaxy observed at a small viewing angle. The southern component can be interpreted as the region of the approaching jets terminal hotspot and the halo-like diffuse component near the core can be interpreted as the counter-hotspot region. From the differential Doppler boosting of both features, we can derive the hotspot advance speed to $(0.01-0.036)$ c. At a constant advance speed, the derived age of the source would exceed the total lifetime of such a powerful FR II-like radio galaxy substantially. Thus, the hotspot advance speed must have been higher in the past in agreement with a scenario in which the originally highly relativistic jet has lost collimation due to the growth of instabilities and has transformed into an only mildly relativistic flow. Our data suggest that the density of the intergalactic medium around this distant ($z=2.22$) AGN could be substantially higher than the values typically found in less distant FR II radio galaxies.