The measurements of the Hubble constant reveal a tension between high-redshift (CMB) and low-redshift (distance ladder) constraints. So far neither observational systematics nor new physics has been successfully implemented to explain this tension away. This paper present a new solution to the Hubble constant problem. It uses a relativistic simulation of the large scale structure of the Universe (the Simsilun simulation) together with the ray-tracing algorithm. The Simsilun simulation allows for relativistic and nonlinear evolution of cosmic structures, which results with a phenomenon of emerging spatial curvature, where the spatial curvature evolves from spatial flatness of the early universe towards slightly curved present-day universe. This phenomenon speeds up the expansion rate compared to the spatially flat \(\Lambda\)CDM model. The results of the ray-tracing analysis show that the universe which starts with initial conditions consistent with the Planck constraints should have the Hubble constant \(H_0 = 72.5 \pm 2.1\) km s\(^{-1}\) Mpc\(^{-1}\). If the relativistic corrections are not included then the results of the simulation and ray-tracing point towards \(H_0 = 68.1 \pm 2.0\) km s\(^{-1}\) Mpc\(^{-1}\). Thus, the inclusion of relativistic effects that lead to emergence of the spatial curvature can explain why the low-redshift measurements favour higher values compared to high-redshift constraints and alleviate the tension between the CMB and distance ladder measurements of the Hubble constant.